|
|
@ -348,11 +348,12 @@ plantuml.init(md, {})
|
|
|
|
// KATEX
|
|
|
|
// KATEX
|
|
|
|
// ========================================
|
|
|
|
// ========================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const macros = {}
|
|
|
|
md.inline.ruler.after('escape', 'katex_inline', katexHelper.katexInline)
|
|
|
|
md.inline.ruler.after('escape', 'katex_inline', katexHelper.katexInline)
|
|
|
|
md.renderer.rules.katex_inline = (tokens, idx) => {
|
|
|
|
md.renderer.rules.katex_inline = (tokens, idx) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return katex.renderToString(tokens[idx].content, {
|
|
|
|
return katex.renderToString(tokens[idx].content, {
|
|
|
|
displayMode: false
|
|
|
|
displayMode: false, macros
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
console.warn(err)
|
|
|
|
console.warn(err)
|
|
|
@ -365,7 +366,7 @@ md.block.ruler.after('blockquote', 'katex_block', katexHelper.katexBlock, {
|
|
|
|
md.renderer.rules.katex_block = (tokens, idx) => {
|
|
|
|
md.renderer.rules.katex_block = (tokens, idx) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return `<p>` + katex.renderToString(tokens[idx].content, {
|
|
|
|
return `<p>` + katex.renderToString(tokens[idx].content, {
|
|
|
|
displayMode: true
|
|
|
|
displayMode: true, macros
|
|
|
|
}) + `</p>`
|
|
|
|
}) + `</p>`
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
|
console.warn(err)
|
|
|
|
console.warn(err)
|
|
|
|