Enum NodeValue
enum NodeValue
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.
-
List(NodeList) Block. A list. Contains list items.
* * 1. 2.-
Item(NodeList) Block. A list item. Contains other blocks.
-
DescriptionList Block. A description list, enabled with
ext_description_listsoption. Contains description items.It is required to put a blank line between terms and details.
-
DescriptionItem(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
Stringis 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
boolrepresents 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
Textnode.-
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
hardbreaksoption is set inOptionsduring formatting, it will be formatted as aLineBreak.-
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_superscriptoption.-
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.
- --
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
underlineoption.-
Subscript Inline. Subscript. Enabled with
subscriptoptions.-
SpoileredText Inline. Spoilered text. Enabled with
spoileroption.-
EscapedTag(String) Inline. Text surrounded by escaped markup. Enabled with
spoileroption. TheStringis the tag to be escaped.-
Alert(NodeAlert) Block. GitHub style alert boxes which uses a modified blockquote syntax. Enabled with the
alertsoption.
Implementations
impl NodeValue
fn block(self: &Self) -> boolIndicates whether this node is a block node or inline node.
fn contains_inlines(self: &Self) -> boolWhether the type the node is of can contain inline nodes.
fn text(self: &Self) -> Option<&String>Return a reference to the text of a
Textinline, if this node is one.Convenience method.
fn text_mut(self: &mut Self) -> Option<&mut String>Return a mutable reference to the text of a
Textinline, if this node is one.Convenience method.
impl Clone for NodeValue
fn clone(self: &Self) -> NodeValue
impl Debug for NodeValue
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Eq for NodeValue
impl Freeze for NodeValue
impl PartialEq for NodeValue
fn eq(self: &Self, other: &NodeValue) -> bool
impl RefUnwindSafe for NodeValue
impl Send for NodeValue
impl StructuralPartialEq for NodeValue
impl Sync for NodeValue
impl Unpin for NodeValue
impl UnwindSafe for NodeValue
impl<T> Any for NodeValue
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for NodeValue
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for NodeValue
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for NodeValue
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for NodeValue
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for NodeValue
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for NodeValue
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for NodeValue
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for NodeValue
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>