From efa5ef6ca5cd4e9fd1341817894b22383e9f6107 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 23 Oct 2023 16:51:43 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9485 --- app/src/protyle/render/mathRender.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/render/mathRender.ts b/app/src/protyle/render/mathRender.ts index f224b64ab..fcb660a2d 100644 --- a/app/src/protyle/render/mathRender.ts +++ b/app/src/protyle/render/mathRender.ts @@ -3,6 +3,7 @@ import {addStyle} from "../util/addStyle"; import {Constants} from "../../constants"; import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock"; import {hasClosestBlock} from "../util/hasClosest"; +import {looseJsonParse} from "../../util/functions"; export const mathRender = (element: Element, cdn = Constants.PROTYLE_CDN, maxWidth = false) => { let mathElements: Element[] = []; @@ -29,7 +30,7 @@ export const mathRender = (element: Element, cdn = Constants.PROTYLE_CDN, maxWid } let macros = {}; try { - macros = JSON.parse(window.siyuan.config.editor.katexMacros || "{}"); + macros = looseJsonParse(window.siyuan.config.editor.katexMacros || "{}"); } catch (e) { console.warn("KaTex macros is not JSON", e); }