pub enum BlockEvent {
Show 40 variants
ParagraphStart,
ParagraphEnd,
HeadingStart {
level: u8,
},
HeadingEnd {
level: u8,
},
CodeBlockStart {
kind: CodeBlockKind,
},
CodeBlockEnd,
BlockQuoteStart {
callout: Option<CalloutType>,
},
BlockQuoteEnd,
ListStart {
kind: ListKind,
tight: bool,
},
ListEnd {
kind: ListKind,
tight: bool,
},
ListItemStart {
task: TaskState,
},
ListItemEnd,
DefinitionListStart,
DefinitionListEnd,
DefinitionTermStart,
DefinitionTermEnd,
DefinitionDescriptionStart {
tight: bool,
},
DefinitionDescriptionEnd,
ThematicBreak(Range),
Comment(Range),
HtmlBlockStart,
HtmlBlockEnd,
HtmlBlockText(Range),
SoftBreak,
Text(Range),
Code(Range),
VirtualSpaces(u8),
TableStart,
TableColumnWidthsStart,
TableColumnWidth {
basis_points: u16,
},
TableColumnWidthsEnd,
TableEnd,
TableHeadStart,
TableHeadEnd,
TableBodyStart,
TableBodyEnd,
TableRowStart,
TableRowEnd,
TableCellStart {
alignment: Alignment,
colspan: u16,
},
TableCellEnd,
}Expand description
Events emitted by the block parser.
Variants§
ParagraphStart
Start of a paragraph.
ParagraphEnd
End of a paragraph.
HeadingStart
Start of a heading.
HeadingEnd
End of a heading.
CodeBlockStart
Start of a code block.
Fields
kind: CodeBlockKindWhether the block is fenced or indented.
CodeBlockEnd
End of a code block.
BlockQuoteStart
Start of a blockquote (possibly a callout/admonition).
Fields
callout: Option<CalloutType>Callout type, if this blockquote starts with [!TYPE].
BlockQuoteEnd
End of a blockquote.
ListStart
Start of a list.
Fields
ListEnd
End of a list.
ListItemStart
Start of a list item.
ListItemEnd
End of a list item.
DefinitionListStart
Start of a definition list.
DefinitionListEnd
End of a definition list.
DefinitionTermStart
Start of a definition term.
DefinitionTermEnd
End of a definition term.
DefinitionDescriptionStart
Start of a definition description.
DefinitionDescriptionEnd
End of a definition description.
ThematicBreak(Range)
A thematic break (horizontal rule).
The Range covers the marker run and any intervening or trailing
horizontal whitespace on the same line. It excludes container
indentation (leading spaces already consumed by the block loop) and
the line ending character.
Comment(Range)
A source-only line comment omitted by the HTML renderer.
HtmlBlockStart
Start of an HTML block.
HtmlBlockEnd
End of an HTML block.
HtmlBlockText(Range)
Raw HTML block content (not to be inline-parsed or escaped).
SoftBreak
Soft line break (newline within paragraph).
Text(Range)
Inline content range to be parsed by the inline parser.
Code(Range)
Raw code content (not to be inline-parsed).
VirtualSpaces(u8)
Virtual spaces to prepend to code content (from tab expansion). This event is followed by a Code or Text event.
TableStart
Start of a table.
TableColumnWidthsStart
Start of relative column-width hints for a table.
TableColumnWidth
A numeric table column-width hint in hundredths of one percent.
TableColumnWidthsEnd
End of relative column-width hints for a table.
TableEnd
End of a table.
TableHeadStart
Start of a table header section.
TableHeadEnd
End of a table header section.
TableBodyStart
Start of a table body section.
TableBodyEnd
End of a table body section.
TableRowStart
Start of a table row.
TableRowEnd
End of a table row.
TableCellStart
Start of a table cell with alignment.
Fields
TableCellEnd
End of a table cell.
Trait Implementations§
Source§impl Clone for BlockEvent
impl Clone for BlockEvent
Source§fn clone(&self) -> BlockEvent
fn clone(&self) -> BlockEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more