module
TUI::Markdown::Parser
Overview
Hand-rolled line-oriented block parser: walks the source a line at a time with a cursor, dispatching on each line's leading shape into a flat Array(Block). No external Markdown shard is used (shard.yml has zero runtime dependencies) — this recognizes the subset of CommonMark/GFM documented as in-scope on MarkdownView.
Defined in:
tui/markdown/parser.crConstant Summary
-
ATX_HEADING =
/^ {0,3}(\#{1,6})\s+(.*?)\s*\#*\s*$/ -
BLOCKQUOTE =
/^ {0,3}(>+)\s?(.*)$/ -
FENCE_OPEN =
/^ {0,3}(```|~~~)\s*(\S*)\s*$/ -
HRULE =
/^ {0,3}([-*_])( *\1){2,} *$/ -
ORDERED_ITEM =
/^( *)(\d+)[.)]\s+(.*)$/ -
TABLE_DELIM_CELL =
/^:?-+:?$/ -
TABLE_ROW =
/\|/ -
TASK_PREFIX =
/^\[([ xX])\]\s+(.*)$/ -
UNORDERED_ITEM =
/^( *)([-*+])\s+(.*)$/
Class Method Summary
-
.parse(source : String, number_headings : Bool = true, inline_config : Inline::Config = Inline::Config.new) : Array(Block)
ameba:disable Metrics/CyclomaticComplexity
Class Method Detail
def self.parse(source : String, number_headings : Bool = true, inline_config : Inline::Config = Inline::Config.new) : Array(Block)
#
ameba:disable Metrics/CyclomaticComplexity