|
|
@ -287,6 +287,13 @@ export const createMarkdownRenderer = async (
|
|
|
|
md.use(mathPlugin.default ?? mathPlugin, {
|
|
|
|
md.use(mathPlugin.default ?? mathPlugin, {
|
|
|
|
...(typeof options.math === 'boolean' ? {} : options.math)
|
|
|
|
...(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(
|
|
|
|
|
|
|
|
/^<mjx-container /,
|
|
|
|
|
|
|
|
'<mjx-container tabindex="0" '
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
throw new Error(
|
|
|
|
throw new Error(
|
|
|
|
'You need to install `markdown-it-mathjax3` to use math support.'
|
|
|
|
'You need to install `markdown-it-mathjax3` to use math support.'
|
|
|
|