pub enum Node {
Show 21 variants
Document(Vec<Node>),
Heading {
level: u8,
content: Vec<Node>,
},
Paragraph(Vec<Node>),
BlockQuote(Vec<Node>),
CodeBlock {
language: Option<String>,
content: String,
},
UnorderedList(Vec<ListItem>),
OrderedList {
start: u32,
items: Vec<ListItem>,
},
ThematicBreak,
Table {
headers: Vec<Node>,
rows: Vec<Vec<Node>>,
alignments: Vec<Alignment>,
},
Link {
url: String,
title: Option<String>,
content: Vec<Node>,
},
Image {
url: String,
title: Option<String>,
alt: String,
},
Emphasis(Vec<Node>),
Strong(Vec<Node>),
Strike(Vec<Node>),
InlineCode(String),
Text(String),
Inline(Vec<Node>),
Html(String),
HtmlElement(HtmlElement),
SoftBreak,
HardBreak,
}Expand description
Represents a node type in a CommonMark document
Variants§
Document(Vec<Node>)
Root document node, containing child nodes
Heading
Heading, containing level (1-6) and content
Paragraph(Vec<Node>)
Paragraph node, containing inline elements
BlockQuote(Vec<Node>)
Block quote, containing any block-level elements
CodeBlock
Code block, containing optional language identifier and content
UnorderedList(Vec<ListItem>)
Unordered list, containing list items
OrderedList
Ordered list, containing starting number and list items
ThematicBreak
Thematic break (horizontal rule)
Table
Table
Fields
Link
Link
Fields
Image
Image
Emphasis(Vec<Node>)
Emphasis (italic)
Strong(Vec<Node>)
Strong emphasis (bold)
Strike(Vec<Node>)
Strikethrough text
InlineCode(String)
Inline code
Text(String)
Plain text
Inline(Vec<Node>)
Inline container, content is written inline without any formatting or line breaks
Html(String)
HTML block
HtmlElement(HtmlElement)
Custom HTML element with attributes and children
SoftBreak
Soft line break (single newline)
HardBreak
Hard line break (two spaces followed by newline or backslash followed by newline)