Enum comrak::nodes::NodeValue
[−]
[src]
pub enum NodeValue { Document, BlockQuote, List(NodeList), Item(NodeList), CodeBlock(NodeCodeBlock), HtmlBlock(NodeHtmlBlock), Paragraph, Heading(NodeHeading), ThematicBreak, Table(Vec<TableAlignment>), TableRow(bool), TableCell, Text(String), SoftBreak, LineBreak, Code(String), HtmlInline(String), Emph, Strong, Strikethrough, Superscript, Link(NodeLink), Image(NodeLink), }
The core AST node enum.
Variants
Document
The root of every CommonMark document. Contains blocks.
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 item
Item(NodeList)
Block. A list item. Contains other blocks.
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.
Table(Vec<TableAlignment>)
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.
SoftBreak
Inline. A soft line break. If
the hardbreaks
option is set in ComrakOptions
during formatting, it will be formatted
as a LineBreak
.
LineBreak
Inline. A hard line break.
Code(String)
Inline. A code span.
HtmlInline(String)
Inline. Raw HTML contained inline.
Emph
Inline. Emphasised 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.
Methods
impl NodeValue
[src]
fn block(&self) -> bool
Indicates whether this node is a block node or inline node.
fn contains_inlines(&self) -> bool
Indicates whether this node may contain inlines.
fn text(&self) -> Option<&String>
Return a reference to the text of a Text
inline, if this node is one.
Convenience method.
fn text_mut(&mut self) -> Option<&mut String>
Return a mutable reference to the text of a Text
inline, if this node is one.
Convenience method.
Trait Implementations
impl Debug for NodeValue
[src]
impl Clone for NodeValue
[src]
fn clone(&self) -> NodeValue
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more