Shortcode::Engine
Master shortcode tokenizer and expansion engine.
Constants
CODE_MASK_REGEX = /(?:```|~~~)[^\n]*\r?\n[\s\S]*?\r?\n(?:```|~~~)|`[^`\n]+`/
PARAM_REGEX = /([a-zA-Z0-9_-]+)(?:=(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/
Class methods
expand(html : String, shortcodes : Hash(String, Invocation), compiler : MarkdownCompiler, depth : Int32 = 0, custom_renderer : Proc(Invocation, String, String) | Nil = nil) : String
Expands all shortcode placeholders within compiled HTML using the provided MarkdownCompiler.
Finds the index and length of the corresponding closing tag for a block shortcode.
Parses key-value parameters from a shortcode invocation string.
Renders an individual shortcode invocation to HTML.