pub struct ParsedTable {
pub header_rows: usize,
pub rows: Vec<Vec<ParsedTableCell>>,
pub blockquote_depth: u32,
pub blockquote_opens: u32,
}Expand description
A parsed table extracted from markdown or HTML.
Fields§
§header_rows: usizeNumber of header rows (typically 1 for markdown tables).
rows: Vec<Vec<ParsedTableCell>>All rows (header + body), each containing cells with their inline spans.
blockquote_depth: u32Blockquote nesting depth at the point the table appeared
(0 = not inside a blockquote), mirroring ParsedBlock::blockquote_depth.
blockquote_opens: u32How many of those quotations open at the table, mirroring
ParsedBlock::blockquote_opens.
Implementations§
Source§impl ParsedTable
impl ParsedTable
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
How many columns the table needs to hold every cell it has: as many as its widest row has cells. A row shorter than that is completed with empty cells by whoever builds the table.
The first row does not say it. The rows of a Djot table differ in length when their source does, and an HTML table’s first row is often one heading cell spanning every column: a table sized from its first row kept the cells of a longer row in the model, where they showed, while every export writes a row up to the table’s width only, so the first save dropped them.