pub struct MdNode {Show 29 fields
pub node_type: NodeType,
pub parent: Option<NodeId>,
pub first_child: Option<NodeId>,
pub last_child: Option<NodeId>,
pub prev: Option<NodeId>,
pub next: Option<NodeId>,
pub sourcepos: SourcePos,
pub literal: String,
pub level: usize,
pub destination: String,
pub title: Option<String>,
pub info: Option<String>,
pub is_fenced: bool,
pub fence_char: u8,
pub fence_length: usize,
pub fence_offset: usize,
pub list_data: Option<ListData>,
pub table_align: Option<Vec<TableAlign>>,
pub is_header_row: bool,
pub checked: Option<bool>,
pub gfm: bool,
pub open: bool,
pub string_content: String,
pub last_line_blank: bool,
pub last_line_checked: bool,
pub content_line: usize,
pub label: String,
pub reference_type: Option<ReferenceType>,
pub definitions: Vec<DefinitionSite>,
}Expand description
One node of the tree.
Fields§
§node_type: NodeType§parent: Option<NodeId>§first_child: Option<NodeId>§last_child: Option<NodeId>§prev: Option<NodeId>§next: Option<NodeId>§sourcepos: SourcePos§literal: StringText payload for text / code / html_block / html_inline / code_block.
level: usizeHeading level 1..6.
destination: StringLink/image destination, already entity-decoded and backslash-unescaped.
title: Option<String>Link/image title, already entity-decoded and backslash-unescaped.
None is the canonical runtime’s null (the Go port’s HasTitle
false).
info: Option<String>Fenced code info string (raw, entity-decoded); None for indented
code, which is the canonical null and Go’s HasInfo false.
is_fenced: boolTrue for fenced code blocks, false for indented.
fence_char: u8§fence_length: usize§fence_offset: usize§list_data: Option<ListData>§table_align: Option<Vec<TableAlign>>GFM tables: one entry per column, in order, set on the table node
by the block phase from the delimiter row. Every row of the table,
header and body alike, has exactly this many cells, because short
rows are padded and long ones are truncated. None on every other
node type.
is_header_row: boolGFM tables: true on the one table_row that is the header row, which
is always the table’s first child. mdast has no header flag and
relies on that convention, but the renderer needs to choose <th>
over <td> without walking back up to the table.
checked: Option<bool>GFM task list items (- [x] foo): Some(true) / Some(false) for a
checked / unchecked item, None for an ordinary one. Set on item
nodes by the block phase when gfm is on, once the marker has been
consumed from the item’s first paragraph. mdast’s field and mdast’s
semantics; ast.rs projects it straight through to
listItem.checked.
gfm: boolThe gfm parse option, recorded on the document node by the
block phase and meaningless anywhere else. The renderer defaults to
it when called without options, so a tree parsed as plain CommonMark
renders as plain CommonMark.
open: boolOpen blocks accept further lines; closed ones are finalized.
string_content: StringAccumulated raw content, consumed by the inline phase.
last_line_blank: boolA block whose last line was blank cannot be lazily continued.
last_line_checked: bool§content_line: usizeA paragraph’s source line where string_content begins: its first
line, moved on past each definition read off the front, so a
definition read later knows its lines.
label: StringA link_reference’s or image_reference’s label (its raw source
text, between its brackets) and the form that named it.
reference_type: Option<ReferenceType>§definitions: Vec<DefinitionSite>A container’s link reference definitions, read from paragraphs among its children, each with where it stands.