pub enum NodeValue {
Show 41 variants
Document,
FrontMatter(String),
BlockQuote,
List(NodeList),
Item(NodeList),
DescriptionList,
DescriptionItem(NodeDescriptionItem),
DescriptionTerm,
DescriptionDetails,
CodeBlock(NodeCodeBlock),
HtmlBlock(NodeHtmlBlock),
Paragraph,
Heading(NodeHeading),
ThematicBreak,
FootnoteDefinition(NodeFootnoteDefinition),
Table(NodeTable),
TableRow(bool),
TableCell,
Text(String),
TaskItem(Option<char>),
SoftBreak,
LineBreak,
Code(NodeCode),
HtmlInline(String),
Raw(String),
Emph,
Strong,
Strikethrough,
Superscript,
Link(NodeLink),
Image(NodeLink),
FootnoteReference(NodeFootnoteReference),
Math(NodeMath),
MultilineBlockQuote(NodeMultilineBlockQuote),
Escaped,
WikiLink(NodeWikiLink),
Underline,
Subscript,
SpoileredText,
EscapedTag(String),
Alert(NodeAlert),
}Expand description
The core AST node enum.
Variants§
Document
The root of every CommonMark document. Contains blocks.
FrontMatter(String)
Non-Markdown front matter. Treated as an opaque blob.
BlockQuote
Block. A block quote. Contains other blocks.
> A block quote.List(NodeList)
Block. A list. Contains list items.
* An unordered list
* Another item
1. An ordered list
2. Another itemItem(NodeList)
Block. A list item. Contains other blocks.
DescriptionList
Block. A description list, enabled with ext_description_lists option. Contains
description items.
It is required to put a blank line between terms and details.
Term 1
: Details 1
Term 2
: Details 2DescriptionItem(NodeDescriptionItem)
Block*. An item of a description list. Contains a term and one details block.
DescriptionTerm
Block. Term of an item in a definition list.
DescriptionDetails
Block. Details of an item in a definition list.
CodeBlock(NodeCodeBlock)
Block. A code block; may be fenced or indented. Contains raw text which is not parsed as Markdown, although is HTML escaped.
HtmlBlock(NodeHtmlBlock)
Block. A HTML block. Contains raw text which is neither parsed as Markdown nor HTML escaped.
Paragraph
Block. A paragraph. Contains inlines.
Heading(NodeHeading)
Block. A heading; may be an ATX heading or a setext heading. Contains inlines.
ThematicBreak
Block. A thematic break. Has no children.
FootnoteDefinition(NodeFootnoteDefinition)
Block. A footnote definition. The String is the footnote’s name.
Contains other blocks.
Table(NodeTable)
Block. A table per the GFM spec. Contains table rows.
TableRow(bool)
Block. A table row. The bool represents whether the row is the header row or not.
Contains table cells.
TableCell
Block. A table cell. Contains inlines.
Text(String)
Inline. Textual content. All text
in a document will be contained in a Text node.
TaskItem(Option<char>)
Block. Task list item. The value is the symbol that was used in the brackets to mark a task item as checked, or None if the item is unchecked.
SoftBreak
Inline. A soft line break. If
the hardbreaks option is set in Options during formatting, it will be formatted
as a LineBreak.
LineBreak
Inline. A hard line break.
Code(NodeCode)
Inline. A code span.
HtmlInline(String)
Inline. Raw HTML contained inline.
Raw(String)
Block/Inline. A Raw output node. This will be inserted verbatim into CommonMark and HTML output. It can only be created programmatically, and is never parsed from input.
Emph
Inline. Emphasized text.
Strong
Inline. Strong text.
Strikethrough
Inline. Strikethrough text per the GFM spec.
Superscript
Inline. Superscript. Enabled with ext_superscript option.
Link(NodeLink)
Inline. A link to some URL, with possible title.
Image(NodeLink)
Inline. An image.
FootnoteReference(NodeFootnoteReference)
Inline. A footnote reference.
Math(NodeMath)
Inline. A math span. Contains raw text which is not parsed as Markdown. Dollar math or code math
Inline math $1 + 2$ and $1 + 2$
Display math $$1 + 2$$ and $$ 1 + 2 $$
MultilineBlockQuote(NodeMultilineBlockQuote)
Block. A multiline block quote. Spans multiple lines and contains other blocks.
>>>
A paragraph.
- item one
- item two
>>>Escaped
Inline. A character that has been escaped
Enabled with escaped_char_spans.
WikiLink(NodeWikiLink)
Inline. A wikilink to some URL.
Underline
Inline. Underline. Enabled with underline option.
Subscript
Inline. Subscript. Enabled with subscript options.
SpoileredText
Inline. Spoilered text. Enabled with spoiler option.
EscapedTag(String)
Inline. Text surrounded by escaped markup. Enabled with spoiler option.
The String is the tag to be escaped.
Alert(NodeAlert)
Block. GitHub style alert boxes which uses a modified blockquote syntax.
Enabled with the alerts option.
Implementations§
Trait Implementations§
impl Eq for NodeValue
impl StructuralPartialEq for NodeValue
Auto Trait Implementations§
impl Freeze for NodeValue
impl RefUnwindSafe for NodeValue
impl Send for NodeValue
impl Sync for NodeValue
impl Unpin for NodeValue
impl UnwindSafe for NodeValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.