瀏覽代碼

Update mathRender.ts (#8963)

TinkMingKing 1 年之前
父節點
當前提交
ae259933ca
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      app/src/protyle/render/mathRender.ts

+ 2 - 0
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);