fix: [no ci] WIP repeatable table headers/footers

This commit is contained in:
Tobias Schmitz 2025-07-01 17:47:18 +02:00
parent 22bbabca38
commit 5543400ff1
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View File

@ -817,6 +817,10 @@ pub struct TableCell {
// TODO: feature gate
pub header_scope: Smart<TableHeaderScope>,
// 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

View File

@ -230,7 +230,7 @@ impl TableCtx {
}
a
})
.expect("tables must have at least one column")
.unwrap_or(TableCellKind::Data)
})
.collect::<Vec<_>>();
@ -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::<TableCell>() {
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::<LinkMarker>() {
let link_id = gc.tags.next_link_id();