From 773efb5572c0eb18163001359c4e4f06d4dba5f2 Mon Sep 17 00:00:00 2001 From: Tobias Schmitz Date: Tue, 1 Jul 2025 16:09:41 +0200 Subject: [PATCH] fix: bug due to table cell start tags in grid layout code --- crates/typst-layout/src/grid/layouter.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/typst-layout/src/grid/layouter.rs b/crates/typst-layout/src/grid/layouter.rs index 42fe38dbe..78057f106 100644 --- a/crates/typst-layout/src/grid/layouter.rs +++ b/crates/typst-layout/src/grid/layouter.rs @@ -1284,10 +1284,18 @@ impl<'a> GridLayouter<'a> { if let Some([first, rest @ ..]) = frames.get(measurement_data.frames_in_previous_regions..) { + // HACK: reconsider if this is the right decision + fn is_empty_frame(frame: &Frame) -> bool { + !frame.items().any(|(_, item)| match item { + FrameItem::Group(group) => is_empty_frame(&group.frame), + FrameItem::Tag(_) => false, + _ => true, + }) + } if can_skip && breakable - && first.is_empty() - && rest.iter().any(|frame| !frame.is_empty()) + && is_empty_frame(first) + && rest.iter().any(|frame| !is_empty_frame(frame)) { return Ok(None); }