From df6a4ba7f4a2702107269212bcad87059fc3b8e0 Mon Sep 17 00:00:00 2001 From: Tobias Schmitz Date: Fri, 1 Aug 2025 14:24:23 +0200 Subject: [PATCH] fix: allow closing mismatched tags while in artifacts --- crates/typst-pdf/src/tags/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/typst-pdf/src/tags/mod.rs b/crates/typst-pdf/src/tags/mod.rs index 5c7720e44..e2b5d975f 100644 --- a/crates/typst-pdf/src/tags/mod.rs +++ b/crates/typst-pdf/src/tags/mod.rs @@ -294,11 +294,10 @@ pub fn handle_end( return Ok(()); } - // FIXME: Overlapping tags in artifacts will break the close mechanism. - if let Some((l, _)) = gc.tags.in_artifact { - if l == loc { - pop_artifact(gc, surface); - } + if let Some((l, _)) = gc.tags.in_artifact + && l == loc + { + pop_artifact(gc, surface); return Ok(()); }