diff --git a/crates/engine/src/clip_html.rs b/crates/engine/src/clip_html.rs
index e1d217c9c..fa9822390 100644
--- a/crates/engine/src/clip_html.rs
+++ b/crates/engine/src/clip_html.rs
@@ -17,11 +17,13 @@ const MAX_ROW_SPAN: usize = gridcraft_core::MAX_ROWS as usize;
/// table is ignored: the HTML only refines cells of the tab-separated text, which stays the source.
const MAX_HTML_CELLS: usize = 1_000_000;
-/// One table cell: its visible text and the number the source recorded for it, if any.
+/// One table cell: its visible text, the number the source recorded for it, if any, and whether
+/// it is a header cell (`
`).
#[derive(Clone, Debug, Default, PartialEq)]
pub(crate) struct HtmlCell {
pub text: String,
pub num: Option,
+ pub header: bool,
}
/// The cells of the first table in `html`, row by row, read no further than `max_rows` rows of
@@ -88,7 +90,7 @@ pub(crate) fn table_cells(html: &str, max_rows: usize, max_cols: usize) -> Vec().ok()).filter(|n| n.is_finite());
let colspan = span(attrs, "colspan", MAX_SPAN);
let rowspan = span(attrs, "rowspan", MAX_ROW_SPAN);
- cell = Some(OpenCell { cell: HtmlCell { text: String::new(), num }, colspan, rowspan });
+ cell = Some(OpenCell { cell: HtmlCell { text: String::new(), num, header: name == "th" }, colspan, rowspan });
}
("td" | "th", true) | ("tr", true) => grid.finish(&mut cell),
("br", _) => {
@@ -376,18 +378,18 @@ mod tests {
| 2.50 & up | x | |