diff --git a/composables/content.ts b/composables/content.ts index 05909c3c..892fe787 100644 --- a/composables/content.ts +++ b/composables/content.ts @@ -60,7 +60,7 @@ export function contentToVNode( return `:${name}:` }) // handle code frames - .replace(/

(```|~~~)([\s\S]+?)\1(\s|)*<\/p>/g, (_1, _2, raw) => { + .replace(/

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

${raw}

`).trim() const [lang, ...rest] = plain.split(/\n/) return `` diff --git a/composables/shiki.ts b/composables/shiki.ts index dfd097a6..1b43ab32 100644 --- a/composables/shiki.ts +++ b/composables/shiki.ts @@ -15,9 +15,6 @@ export function highlightCode(code: string, lang: Lang) { 'vitesse-dark', 'vitesse-light', ], - langs: [ - lang, - ], }) }) }