[][src]Enum comrak::nodes::NodeValue

pub enum NodeValue {
    Document,
    BlockQuote,
    List(NodeList),
    Item(NodeList),
    DescriptionList,
    DescriptionItem(NodeDescriptionItem),
    DescriptionTerm,
    DescriptionDetails,
    CodeBlock(NodeCodeBlock),
    HtmlBlock(NodeHtmlBlock),
    Paragraph,
    Heading(NodeHeading),
    ThematicBreak,
    FootnoteDefinition(Vec<u8>),
    Table(Vec<TableAlignment>),
    TableRow(bool),
    TableCell,
    Text(Vec<u8>),
    TaskItem(bool),
    SoftBreak,
    LineBreak,
    Code(Vec<u8>),
    HtmlInline(Vec<u8>),
    Emph,
    Strong,
    Strikethrough,
    Superscript,
    Link(NodeLink),
    Image(NodeLink),
    FootnoteReference(Vec<u8>),
}

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.

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 2
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(Vec<u8>)

Block. A footnote definition. The Vec<u8> is the footnote's name. Contains other blocks.

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(Vec<u8>)

Inline. Textual content. All text in a document will be contained in a Text node.

TaskItem(bool)

Inline. Task list item. The bool indicates whether it is checked or not.

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(Vec<u8>)

Inline. A code span.

HtmlInline(Vec<u8>)

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.

FootnoteReference(Vec<u8>)

Inline. A footnote reference; the Vec<u8> is the referent footnote's name.

Methods

impl NodeValue[src]

pub fn block(&self) -> bool[src]

Indicates whether this node is a block node or inline node.

pub fn contains_inlines(&self) -> bool[src]

Indicates whether this node may contain inlines.

pub fn text(&self) -> Option<&Vec<u8>>[src]

Return a reference to the text of a Text inline, if this node is one.

Convenience method.

pub fn text_mut(&mut self) -> Option<&mut Vec<u8>>[src]

Return a mutable reference to the text of a Text inline, if this node is one.

Convenience method.

Trait Implementations

impl Clone for NodeValue[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> From<NodeValue> for AstNode<'a>[src]

fn from(value: NodeValue) -> Self[src]

Create a new AST node with the given value.

impl Debug for NodeValue[src]

Auto Trait Implementations

impl Send for NodeValue

impl Sync for NodeValue

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]