mirror of
https://github.com/typst/typst
synced 2025-07-27 22:37:54 +08:00
feat: wrap table cell content in a paragraph
This commit is contained in:
parent
b0d3c2dca4
commit
7d5b9a716f
@ -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())],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user