Skip to main content

Module block

Module block 

Source
Expand description

Block-level markdown parser → MdBlock sequence.

Parses a multi-line string into a flat list of block-level elements. For blocks that carry inline text (headings, paragraphs, blockquotes, list items) the text is forwarded to super::inline::parse_inline_markdown to produce the final crate::ast::node::TextSpan spans.

§Supported block syntax

SyntaxProduces
# …###### …Heading { level: 1..=6, … }
Two or more consecutive non-blankParagraph { … }
> … (consecutive)Blockquote { … }
- / * / + prefixListItem { kind: Unordered, … }
1. / 2. … prefixListItem { kind: Ordered, … }
`````` (fenced)CodeBlock { lang, content }
--- / *** / ___ / - - -HorizontalRule

§Non-goals (V1)

Setext headings, nested blockquote trees, true list-tree nesting, GFM tables, reference links, HTML blocks, indented (4-space) code blocks, and task checkboxes are not recognised; they degrade to Paragraph or the nearest applicable block kind.

Enums§

ListKind
The kind of a markdown list item.
MdBlock
A parsed block-level markdown element.

Functions§

parse_block_markdown
Parse a markdown document into a flat list of MdBlocks.