fix (client): set displayMode to true for block math expressions

This commit is contained in:
naskya 2024-04-13 19:46:31 +09:00
parent d0de0d14b2
commit d57c9dc289
No known key found for this signature in database
GPG Key ID: 712D413B3A9FED5C
1 changed files with 2 additions and 4 deletions

View File

@ -20,12 +20,10 @@ export default defineComponent({
},
computed: {
compiledFormula(): any {
const katexString = katex.renderToString(this.formula, {
return katex.renderToString(this.formula, {
throwOnError: false,
displayMode: this.block,
} as any);
return this.block
? `<div style="text-align:center">${katexString}</div>`
: katexString;
},
},
});