pub enum Node {
Show 22 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>,
},
HtmlBlock(String),
Text(String),
Emphasis(Vec<Node>),
Strong(Vec<Node>),
Strike(Vec<Node>),
InlineCode(String),
Link {
url: String,
title: Option<String>,
content: Vec<Node>,
},
Image {
url: String,
title: Option<String>,
alt: Vec<Node>,
},
InlineContainer(Vec<Node>),
HtmlElement(HtmlElement),
SoftBreak,
HardBreak,
Custom(Box<dyn CustomNode>),
}Expand description
Main node type, representing an element in a CommonMark document
Variants§
Document(Vec<Node>)
Root document node, contains child nodes
Heading
Heading, contains level (1-6) and inline 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
HtmlBlock(String)
HTML block
Text(String)
Plain text
Emphasis(Vec<Node>)
Emphasis (italic)
Strong(Vec<Node>)
Strong emphasis (bold)
Strike(Vec<Node>)
Strikethrough
InlineCode(String)
Inline code
Link
Link
Image
Image
Fields
InlineContainer(Vec<Node>)
Inline element collection, without formatting and line breaks
HtmlElement(HtmlElement)
HTML inline element
SoftBreak
Soft break (single line break)
HardBreak
Hard break (two spaces followed by a line break, or backslash followed by a line break)
Custom(Box<dyn CustomNode>)
Custom node that allows users to implement their own writing behavior