module Shortcodes

Defined in:

shortcodes.cr

Constant Summary

ERR_MISMATCHED_BRACKET = 2

You are using mismatched brackets. Example: {{% foo >}}

ERR_MISMATCHED_CLOSING_TAG = 1

Error codes

You are closing the wrong shortcode. Example: {{% foo %}} {{% /bar %}}

ERR_TOO_MANY_ARGS = 4

A shortcode has more than 100 arguments. Arguments past the limit are dropped.

ERR_TOO_MANY_SHORTCODES = 3

There are more than 100 shortcodes in the document. Shortcodes past the limit are dropped.

MESSAGES = {ERR_MISMATCHED_BRACKET => "Mismatched closing bracket style", ERR_MISMATCHED_CLOSING_TAG => "Closing shortcode that was never opened", ERR_TOO_MANY_SHORTCODES => "Too many shortcodes in one document (limit 100)", ERR_TOO_MANY_ARGS => "Too many arguments in one shortcode (limit 100)"}

Class Method Summary

Class Method Detail

def self.codepoint_count(bytes : Slice(UInt8)) : Int32 #

Counts UTF-8 codepoints in a byte slice without allocating. A codepoint start byte is anything that is not a continuation byte.


[View source]
def self.extract(c : LibShortcodes::Chunk, s : String) #

[View source]
def self.nice_error(e : Error, s : String) #

[View source]
def self.parse(input : String) #

[View source]