style(mathml): linting

This commit is contained in:
NicolasNewman 2024-04-29 09:46:50 -05:00
parent 7f33ae0f40
commit 1ac9244e68
2 changed files with 6 additions and 3 deletions

View File

@ -342,7 +342,10 @@ export const renderKatex = async (text: string, config: MermaidConfig): Promise<
} }
const { default: katex } = await import('katex'); const { default: katex } = await import('katex');
const outputMode = (config.forceLegacyMathML) || (!isMathMLSupported() && config.legacyMathML) ? 'htmlAndMathml' : 'mathml'; const outputMode =
config.forceLegacyMathML || (!isMathMLSupported() && config.legacyMathML)
? 'htmlAndMathml'
: 'mathml';
return text return text
.split(lineBreakRegex) .split(lineBreakRegex)
.map((line) => .map((line) =>
@ -356,7 +359,7 @@ export const renderKatex = async (text: string, config: MermaidConfig): Promise<
.renderToString(c, { .renderToString(c, {
throwOnError: true, throwOnError: true,
displayMode: true, displayMode: true,
output: outputMode output: outputMode,
}) })
.replace(/\n/g, ' ') .replace(/\n/g, ' ')
.replace(/<annotation.*<\/annotation>/g, '') .replace(/<annotation.*<\/annotation>/g, '')