diff --git a/crates/typst-library/src/model/table.rs b/crates/typst-library/src/model/table.rs index b10bfb002..18d38065f 100644 --- a/crates/typst-library/src/model/table.rs +++ b/crates/typst-library/src/model/table.rs @@ -817,6 +817,10 @@ pub struct TableCell { // TODO: feature gate pub header_scope: Smart, + // FIXME: this should not be public + #[default(false)] + pub is_repeated: bool, + /// Whether rows spanned by this cell can be placed in different pages. /// When equal to `{auto}`, a cell spanning only fixed-size rows is /// unbreakable, while a cell spanning at least one `{auto}`-sized row is diff --git a/crates/typst-pdf/src/tags.rs b/crates/typst-pdf/src/tags.rs index 911278e15..6b0ee9a65 100644 --- a/crates/typst-pdf/src/tags.rs +++ b/crates/typst-pdf/src/tags.rs @@ -230,7 +230,7 @@ impl TableCtx { } a }) - .expect("tables must have at least one column") + .unwrap_or(TableCellKind::Data) }) .collect::>(); @@ -524,7 +524,12 @@ pub(crate) fn handle_start(gc: &mut GlobalContext, elem: &Content) { push_stack(gc, loc, StackEntryKind::Table(TableCtx::new(table.clone()))); return; } else if let Some(cell) = elem.to_packed::() { - push_stack(gc, loc, StackEntryKind::TableCell(cell.clone())); + // TODO: set this in table layout + if cell.is_repeated(StyleChain::default()) { + start_artifact(gc, loc, ArtifactKind::Other); + } else { + push_stack(gc, loc, StackEntryKind::TableCell(cell.clone())); + } return; } else if let Some(link) = elem.to_packed::() { let link_id = gc.tags.next_link_id();