Skip to content

Commit b023c19

Browse files
committed
Filter html before parsing to prevent write crash
1 parent a545beb commit b023c19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/common/MarkdownRender.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ const MarkdownRender: React.FC<MarkdownRenderProps> = ({
204204
return;
205205
}
206206

207-
const el = parse(editing ? html : filter(html));
208-
209-
applyElement(el);
207+
try {
208+
const el = parse(filter(html));
209+
// const el = parse(html);
210+
applyElement(el);
211+
} catch (e) {}
210212
});
211213
}, [applyElement, editing, markdown, onConvertFinish]);
212214

0 commit comments

Comments
 (0)