pub enum Block {
Show 17 variants
Paragraph(Paragraph),
Heading(Heading),
ThematicBreak(ThematicBreak),
BlockQuote(BlockQuote),
Alert(Alert),
List(List),
CodeBlock(CodeBlock),
HtmlBlock(HtmlBlock),
HtmlContainer(HtmlContainer),
Definition(Definition),
FootnoteDefinition(FootnoteDefinition),
Table(Table),
MathBlock(MathBlock),
Frontmatter(Frontmatter),
LeafDirective(LeafDirective),
ContainerDirective(ContainerDirective),
BlankLine(BlankLine),
}Expand description
A block-level node: the building blocks of a document’s vertical structure.
Variants§
Paragraph(Paragraph)
A paragraph of inline content.
Heading(Heading)
An ATX heading: # h.
ThematicBreak(ThematicBreak)
A thematic break / horizontal rule: ---, ***, or ___.
BlockQuote(BlockQuote)
A block quote: lines prefixed with > .
Alert(Alert)
A GFM alert / admonition: > [!NOTE] etc.
List(List)
A bullet or ordered list.
CodeBlock(CodeBlock)
A fenced (```) or indented code block.
HtmlBlock(HtmlBlock)
A raw HTML block.
HtmlContainer(HtmlContainer)
A structured raw HTML container whose interior is parsed as Markdown.
Definition(Definition)
A link reference definition: [label]: url "title".
FootnoteDefinition(FootnoteDefinition)
A footnote definition: [^id]: text.
Table(Table)
A GFM pipe table.
MathBlock(MathBlock)
A display math block: $$ … $$.
Frontmatter(Frontmatter)
A leading frontmatter block (--- YAML or +++ TOML).
LeafDirective(LeafDirective)
A leaf directive: ::name[label]{attrs}.
ContainerDirective(ContainerDirective)
A container directive: :::name … :::.
BlankLine(BlankLine)
A blank line beyond the one that separates two blocks.
Implementations§
Source§impl Block
impl Block
Sourcepub fn children(&self) -> &[Block]
pub fn children(&self) -> &[Block]
The blocks directly inside this block: a block quote’s, an alert’s, a
footnote definition’s, a container directive’s, or an HTML container’s
that holds blocks; an empty slice for every other block. A list’s
blocks are in its items (ListItem::children), as NodePath
counts them, so a walker over blocks steps into a list’s items itself.