diff --git a/composables/content.ts b/composables/content.ts index d4857138..b0b2476d 100644 --- a/composables/content.ts +++ b/composables/content.ts @@ -60,10 +60,9 @@ export function contentToVNode( return `:${name}:` }) // handle code frames - .replace(/

(```|~~~)([\s\S]+?)\1/g, (_1, _2, raw) => { - const plain = htmlToText(`

${raw}

`).trim() - const [lang, ...rest] = plain.split(/\n/) - return `` + .replace(/

(```|~~~)([\w]*)([\s\S]+?)\1/g, (_1, _2, lang, raw) => { + const code = htmlToText(`

${raw}

`) + return `` }) const tree = parseFragment(content)