Block state machine with pattern-based detection for CommonMark block structures: headings, code fences, thematic breaks, lists, tables, blockquotes, divs, link references, and footnotes.
| Name | Signature |
|---|---|
is_blank_line | is_blank_line(line) -> blank |
detect_heading | detect_heading(line) -> level, content |
detect_code_fence_open | detect_code_fence_open(line) -> fence_char, fence_len, info, indent |
is_code_fence_close | is_code_fence_close(line, fence_char, fence_len) -> closed |
detect_thematic_break | detect_thematic_break(line) -> is_break |
detect_ul_marker | detect_ul_marker(line) -> marker, content, pre_indent, content_indent, task_info |
detect_ol_marker | detect_ol_marker(line) -> start_num, delimiter, content, pre_indent, content_indent |
detect_list_item | detect_list_item(line) -> type, attrs |
parse_table_row | parse_table_row(line) -> cells |
detect_table_delimiter | detect_table_delimiter(line) -> alignments |
detect_block | detect_block(line) -> block_type, attrs |
can_interrupt_paragraph | can_interrupt_paragraph(block_type, attrs) -> can_interrupt |
detect_link_reference | detect_link_reference(line) -> label, dest, title |
detect_footnote_definition | detect_footnote_definition(line) -> label, content, indent |
detect_blockquote | detect_blockquote(line) -> content, indent |
detect_div_fence_open | detect_div_fence_open(line) -> fence_len, class_name, indent |
is_div_fence_close | is_div_fence_close(line, fence_len) -> closed |
is_blank_line(
line) ->blank
Check if a line is blank or contains only whitespace
detect_heading(
line) ->level,content
Detect ATX heading (# through ######)
detect_code_fence_open(
line) ->fence_char,fence_len,info,indent
Detect fenced code block opening
is_code_fence_close(
line,fence_char,fence_len) ->closed
Check if a line closes a code fence
detect_thematic_break(
line) ->is_break
Detect thematic break (---, ***, ___)
detect_ul_marker(
line) ->marker,content,pre_indent,content_indent,task_info
Detect unordered list marker with optional task list syntax
detect_ol_marker(
line) ->start_num,delimiter,content,pre_indent,content_indent
Detect ordered list marker (digits followed by . or ))
detect_list_item(
line) ->type,attrs
Detect any list item (ordered or unordered)
parse_table_row(
line) ->cells
Parse a GFM table row into an array of cell strings
detect_table_delimiter(
line) ->alignments
Detect GFM table delimiter row and parse column alignments
detect_block(
line) ->block_type,attrs
Detect block type from a line
can_interrupt_paragraph(
block_type,attrs) ->can_interrupt
Check if a block type can interrupt a paragraph
detect_link_reference(
line) ->label,dest,title
Detect link reference definition
detect_footnote_definition(
line) ->label,content,indent
Detect footnote definition
detect_blockquote(
line) ->content,indent
Detect blockquote line
detect_div_fence_open(
line) ->fence_len,class_name,indent
Detect fenced div opening (Djot extension)
is_div_fence_close(
line,fence_len) ->closed
Check if a line closes a div fence