Draw cline partial rules in alignment tables

This commit is contained in:
gloamxun committed 2026-10-24 23:54:38 +08:00
1 parent 78ffd054d4
commit 2868a8f0d3
5 files changed
+64 -4

No files matched your search

+19
View File
@@ -5255,6 +5255,25 @@ mod source_tests {
assert_eq!(second.caption.as_deref(), Some("Figure 1: Numbered"));
}
#[test]
fn tabular_cline_draws_partial_rules() {
let source = r"\begin{tabular}{ll}
A & B \\
\cline{2-2}
C & D \\
\end{tabular}";
let (body, geometry) = geometry_and_body(source);
let blocks = paragraphs(&body).unwrap();
let document = build_document(&blocks, &geometry);
let Some(VerticalItem::Halign(halign)) = document.units[0].items.first() else {
panic!("expected halign");
};
assert_eq!(halign.rows.len(), 2);
assert_eq!(halign.rules.len(), 1);
assert_eq!(halign.rules[0].start, 1);
assert_eq!(halign.rules[0].end, 1);
}
#[test]
fn tabular_multicolumn_cells_span_columns() {
let source = r"\begin{tabular}{|l|c|}