mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
groups: wrap bare link in list-item in p node for better typography
This commit is contained in:
parent
2f7bc1e847
commit
4d80c3f2cd
@ -187,8 +187,20 @@ function stitchInline(a: any, b: any) {
|
||||
if (!a?.children) {
|
||||
throw new Error('Bad stitchInline call: missing root');
|
||||
}
|
||||
|
||||
const lastParaIdx = a.children.length - 1;
|
||||
const last = a.children[lastParaIdx];
|
||||
|
||||
// wrap bare link in list-item inside a p node
|
||||
// for better typography consistency
|
||||
if (last?.type === 'listItem') {
|
||||
if (last?.children.length === 0) {
|
||||
last.children.push({
|
||||
type: 'paragraph',
|
||||
children: []
|
||||
})
|
||||
}
|
||||
}
|
||||
if (last?.children) {
|
||||
const ros = {
|
||||
...a,
|
||||
|
Loading…
Reference in New Issue
Block a user