Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

Update mathRender.ts (#8963)

TinkMingKingae259933cab8
diff --git a/app/src/protyle/render/mathRender.ts b/app/src/protyle/render/mathRender.ts
index 8c4a4bcf92..74ee8680d9 100644
--- a/app/src/protyle/render/mathRender.ts
+++ b/app/src/protyle/render/mathRender.ts
@@ -10,6 +10,7 @@ declare const katex: {
output: string;
macros: IObject;
trust: boolean;
+ strict: (errorCode:string) => 'ignore' | 'warn';
}): string;
};
@@ -48,6 +49,7 @@ export const mathRender = (element: Element, cdn = Constants.PROTYLE_CDN, maxWid
output: "html",
macros,
trust: true, // REF: https://katex.org/docs/supported#html
+ strict: (errorCode) => errorCode === 'unicodeTextInMathMode' ? 'ignore' : 'warn',
});
renderElement.classList.remove("ft__error");
const blockElement = hasClosestBlock(mathElement);