fix(markdown): 修复小概率情况下公式加载失败问题
This commit is contained in:
committed by
lyingbug
parent
a232b12ff0
commit
a3c3ba5acf
@@ -55,7 +55,7 @@ marked.use({
|
||||
breaks: true, // 启用单行换行转 <br>
|
||||
gfm: true, // 启用 GitHub Flavored Markdown
|
||||
});
|
||||
marked.use(markedKatex({ throwOnError: false }));
|
||||
marked.use(markedKatex({ throwOnError: false, nonStandard: true }));
|
||||
|
||||
const preprocessMathDelimiters = (rawText: string): string => {
|
||||
if (!rawText || typeof rawText !== 'string') {
|
||||
|
||||
@@ -218,7 +218,7 @@ async function renderMarkdown(blob: Blob) {
|
||||
breaks: true,
|
||||
gfm: true,
|
||||
});
|
||||
marked.use(markedKatex({ throwOnError: false }));
|
||||
marked.use(markedKatex({ throwOnError: false, nonStandard: true }));
|
||||
const renderer = new marked.Renderer();
|
||||
renderer.code = function ({text, lang}) {
|
||||
// 空值校验:防止 text 为 undefined 或 null
|
||||
|
||||
Reference in New Issue
Block a user