perf: shikiji 处理转译字符

This commit is contained in:
pengzhanbo 2023-12-24 02:16:49 +08:00
parent 49236d812d
commit 58eb1c88a0

View File

@ -116,7 +116,7 @@ export async function highlight(
return s.replace(
/(<span class="line highlighted">)(<\/span>)/g,
'$1<wbr>$2'
) + '\n'
).replace(/(\/\/\s*?\[)\\(!code.*?\])/g, '$1$2') + '\n'
}
str = removeMustache(str).trimEnd()
@ -125,13 +125,6 @@ export async function highlight(
lang,
transformers: [
...transformers,
// transformerCompactLineOptions(lineOptions),
// {
// name: 'vitepress:v-pre',
// pre(node) {
// if (vPre) node.properties['v-pre'] = ''
// }
// },
...userTransformers
],
meta: {