From e4021390a37547988d17ce0131ad60b7230a9a2d Mon Sep 17 00:00:00 2001 From: Tobias Schmitz Date: Mon, 14 Jul 2025 10:13:21 +0200 Subject: [PATCH] feat: don't wrap table cell content in paragraph --- crates/typst-pdf/src/tags/table.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/typst-pdf/src/tags/table.rs b/crates/typst-pdf/src/tags/table.rs index 0bde00c94..b8522569a 100644 --- a/crates/typst-pdf/src/tags/table.rs +++ b/crates/typst-pdf/src/tags/table.rs @@ -180,11 +180,7 @@ impl TableCtx { ) .into(), }; - - // Wrap content in a paragraph. - // TODO: maybe avoid nested paragraphs? - let par = TagNode::Group(TagKind::P.into(), cell.nodes); - Some(TagNode::Group(tag, vec![par])) + Some(TagNode::Group(tag, cell.nodes)) }) .collect(); @@ -422,7 +418,7 @@ mod tests { TagNode::Group( TagKind::TH(TableHeaderCell::new(scope).with_headers(TagIdRefs { ids })) .with_id(Some(id)), - vec![TagNode::Group(TagKind::P.into(), Vec::new())], + Vec::new(), ) } @@ -433,7 +429,7 @@ mod tests { .collect(); TagNode::Group( TagKind::TD(TableDataCell::new().with_headers(TagIdRefs { ids })).into(), - vec![TagNode::Group(TagKind::P.into(), Vec::new())], + Vec::new(), ) }