module

TUI::Markdown::Inline

Scans one line/paragraph's raw text into a flat Array(InlineRun), resolving emphasis (*/_, doubled and tripled), strikethrough (~~, GFM), inline code (backtick-fenced), links ([text](url)), and backslash-escapes. Deliberately non-nesting: the first opening delimiter's matching closer ends that span outright, rather than tracking a delimiter stack — covers the overwhelming majority of real-world Markdown while keeping the scanner a single linear left-to-right pass with no backtracking. An opening delimiter with no matching closer anywhere ahead degrades to literal text (emitted as-is) rather than consuming the rest of the line or raising, since a hand-rolled scanner must never hang on malformed input.

Constants

ESCAPABLE = "\\`*_[]~"

Class methods

parse(text : String, base_style : Style = Style.new, config : Config = Config.new) : Array(InlineRun)

ameba:disable Metrics/CyclomaticComplexity

Source

Nested types