소스 검색

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;
         output: string;
         macros: IObject;
         macros: IObject;
         trust: boolean;
         trust: boolean;
+        strict: (errorCode:string) =>  'ignore' | 'warn';
     }): string;
     }): string;
 };
 };
 
 
@@ -48,6 +49,7 @@ export const mathRender = (element: Element, cdn = Constants.PROTYLE_CDN, maxWid
                         output: "html",
                         output: "html",
                         macros,
                         macros,
                         trust: true, // REF: https://katex.org/docs/supported#html
                         trust: true, // REF: https://katex.org/docs/supported#html
+                        strict: (errorCode) => errorCode === 'unicodeTextInMathMode' ? 'ignore' : 'warn',
                     });
                     });
                     renderElement.classList.remove("ft__error");
                     renderElement.classList.remove("ft__error");
                     const blockElement = hasClosestBlock(mathElement);
                     const blockElement = hasClosestBlock(mathElement);