pub struct MarkdownBlock {
pub kind: MarkdownBlockKind,
pub text: String,
pub quote_depth: u8,
pub list_depth: u8,
pub marker: ListStyle,
pub blank_before: bool,
}Expand description
One leaf block of a Markdown document, with the containers around it flattened into
depths: a paragraph inside a list item inside a quote is one block with
quote_depth == 1 and list_depth == 1.
Flat, because a view lays a document out as a column of rows and updates it row by row. A nested tree would make “the last row changed” a walk through every enclosing container.
Fields§
§kind: MarkdownBlockKind§text: StringInline Markdown for a paragraph or heading (give it to parse), the literal code
for a code block, empty for a rule.
quote_depth: u8How many block quotes enclose this block.
list_depth: u8How many list items enclose this block: 0 outside a list, 1 in a top-level item.
marker: ListStyleThe marker to draw beside this block: Bullet or Ordered(n) on the first block of a
list item, None everywhere else (a second paragraph in the same item, text outside
a list). An ordered list counts up from the number its first item was written with.
blank_before: boolA blank line separated this block from the one before it. A view uses it to tell a tight list from a loose one.