mirror of
https://github.com/typst/typst
synced 2025-07-27 14:27:56 +08:00
feat: don't wrap table cell content in paragraph
This commit is contained in:
parent
2621c6416e
commit
e4021390a3
@ -180,11 +180,7 @@ 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();
|
||||||
|
|
||||||
@ -422,7 +418,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![TagNode::Group(TagKind::P.into(), Vec::new())],
|
Vec::new(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +429,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![TagNode::Group(TagKind::P.into(), Vec::new())],
|
Vec::new(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user