feat: wrap table cell content in a paragraph

This commit is contained in:
Tobias Schmitz 2025-07-07 12:30:56 +02:00
parent b0d3c2dca4
commit 7d5b9a716f
No known key found for this signature in database

View File

@ -180,7 +180,10 @@ impl TableCtx {
.into(), .into(),
}; };
Some(TagNode::Group(tag, cell.nodes)) // 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]))
}) })
.collect(); .collect();
@ -399,7 +402,7 @@ mod tests {
TagNode::Group( TagNode::Group(
TagKind::TH(TableHeaderCell::new(scope).with_headers(TagIdRefs { ids })) TagKind::TH(TableHeaderCell::new(scope).with_headers(TagIdRefs { ids }))
.with_id(Some(id)), .with_id(Some(id)),
Vec::new(), vec![TagNode::Group(TagKind::P.into(), Vec::new())],
) )
} }
@ -410,7 +413,7 @@ mod tests {
.collect(); .collect();
TagNode::Group( TagNode::Group(
TagKind::TD(TableDataCell::new().with_headers(TagIdRefs { ids })).into(), TagKind::TD(TableDataCell::new().with_headers(TagIdRefs { ids })).into(),
Vec::new(), vec![TagNode::Group(TagKind::P.into(), Vec::new())],
) )
} }