mirror of
https://github.com/typst/typst
synced 2025-08-20 17:58:32 +08:00
fix: [no ci] WIP repeatable table headers/footers
This commit is contained in:
parent
22bbabca38
commit
5543400ff1
@ -817,6 +817,10 @@ pub struct TableCell {
|
|||||||
// TODO: feature gate
|
// TODO: feature gate
|
||||||
pub header_scope: Smart<TableHeaderScope>,
|
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.
|
/// Whether rows spanned by this cell can be placed in different pages.
|
||||||
/// When equal to `{auto}`, a cell spanning only fixed-size rows is
|
/// When equal to `{auto}`, a cell spanning only fixed-size rows is
|
||||||
/// unbreakable, while a cell spanning at least one `{auto}`-sized row is
|
/// unbreakable, while a cell spanning at least one `{auto}`-sized row is
|
||||||
|
@ -230,7 +230,7 @@ impl TableCtx {
|
|||||||
}
|
}
|
||||||
a
|
a
|
||||||
})
|
})
|
||||||
.expect("tables must have at least one column")
|
.unwrap_or(TableCellKind::Data)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.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())));
|
push_stack(gc, loc, StackEntryKind::Table(TableCtx::new(table.clone())));
|
||||||
return;
|
return;
|
||||||
} else if let Some(cell) = elem.to_packed::<TableCell>() {
|
} 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;
|
return;
|
||||||
} else if let Some(link) = elem.to_packed::<LinkMarker>() {
|
} else if let Some(link) = elem.to_packed::<LinkMarker>() {
|
||||||
let link_id = gc.tags.next_link_id();
|
let link_id = gc.tags.next_link_id();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user