refactor: simplify line filling a bit

pull/3439/head
Divyansh Singh 11 months ago
parent 862549d068
commit 5dab5e3ced

@ -162,10 +162,8 @@ export async function highlight(
}, },
{ {
name: 'vitepress:empty-line', name: 'vitepress:empty-line',
pre(hast) { code(hast) {
hast.children.forEach((code) => { hast.children.forEach((span) => {
if (code.type === 'element' && code.tagName === 'code') {
code.children.forEach((span) => {
if ( if (
span.type === 'element' && span.type === 'element' &&
span.tagName === 'span' && span.tagName === 'span' &&
@ -182,8 +180,6 @@ export async function highlight(
} }
}) })
} }
})
}
}, },
...userTransformers ...userTransformers
], ],

Loading…
Cancel
Save