diff --git a/src/node/markdown/markdown.ts b/src/node/markdown/markdown.ts index 7b006620..ac675981 100644 --- a/src/node/markdown/markdown.ts +++ b/src/node/markdown/markdown.ts @@ -329,12 +329,17 @@ export async function createMarkdownRenderer( md.use(mathPlugin.default ?? mathPlugin, { ...(typeof options.math === 'boolean' ? {} : options.math) }) - const orig = md.renderer.rules.math_block! - md.renderer.rules.math_block = (tokens, idx, options, env, self) => { - return orig(tokens, idx, options, env, self).replace( - /^> - const userCustomElementChecker = - userVuePluginOptions?.template?.compilerOptions?.isCustomElement - let isCustomElement = userCustomElementChecker - - if (markdown?.math) { - isCustomElement = (tag) => { - if (tag.startsWith('mjx-')) { - return true - } - return userCustomElementChecker?.(tag) ?? false - } - } // lazy require plugin-vue to respect NODE_ENV in @vue/compiler-x const vuePlugin = await import('@vitejs/plugin-vue').then((r) => r.default({ include: /\.(?:vue|md)$/, - ...userVuePluginOptions, - template: { - ...userVuePluginOptions?.template, - compilerOptions: { - ...userVuePluginOptions?.template?.compilerOptions, - isCustomElement - } - } + ...userVuePluginOptions }) )