diff --git a/src/common/marked.js b/src/common/marked.js index de1545f62..a7fdfa78e 100644 --- a/src/common/marked.js +++ b/src/common/marked.js @@ -230,12 +230,12 @@ const kateX = { try { renderString = renderToString(token.text, { displayMode: token.displayMode, - macros: { - "\\mbox": "\\text{#1}", - "\\textrm": "\\text{#1}", - "\\textnormal": "\\text{#1}", - }, - trust: false + macros: { + "\\mbox": "\\text{#1}", + "\\textrm": "\\text{#1}", + "\\textnormal": "\\text{#1}", + }, + trust: false }) } catch (error) { renderString = `
${ token.raw }`
diff --git a/src/components/render-html.jsx b/src/components/render-html.jsx
index a1146b332..a2f6a3b20 100644
--- a/src/components/render-html.jsx
+++ b/src/components/render-html.jsx
@@ -99,13 +99,18 @@ export default ({
rs = rs.split(`#${item.project_issues_index}`).join(content);
}
}
- // rs = rs.replace(/(__special_katext_id_\d+__)/g, (_match, capture) => {
- // const { type, expression } = math_expressions[capture];
- // return renderToString(_unescape(expression) || '', { displayMode: type === 'block', throwOnError: false, output: 'html' })
- // })
- // rs = dompurify.sanitize(rs.replace(/▁/g, "▁▁▁"))
- // rs = rs.split(' {
+ const { type, expression } = math_expressions[capture];
+ return renderToString(_unescape(expression) || '', { displayMode: true, throwOnError: false,macros: {
+ "\\mbox": "\\text{#1}",
+ "\\textrm": "\\text{#1}",
+ "\\textnormal": "\\text{#1}",
+ },
+ trust: false})
+ })
+ rs = dompurify.sanitize(rs.replace(/▁/g, "▁▁▁"))
+ rs = rs.split('
)
-}
+}
\ No newline at end of file