From aaa2a455865550bb30d70283305f3212d7a25649 Mon Sep 17 00:00:00 2001 From: hiyouwhatsapp <89997383+hiyouwhatsapp@users.noreply.github.com> Date: Mon, 2 Nov 2026 16:52:32 +0200 Subject: [PATCH 1/2] test: guard Markdown preview against unfinished HTML comments --- test/html-comment-preview.test.tsx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/html-comment-preview.test.tsx diff --git a/test/html-comment-preview.test.tsx b/test/html-comment-preview.test.tsx new file mode 100644 index 000000000..3c084ede0 --- /dev/null +++ b/test/html-comment-preview.test.tsx @@ -0,0 +1,30 @@ +/** + * @jest-environment jsdom + */ +import React from 'react'; +import { render } from '@testing-library/react'; +import rehypeSanitize from 'rehype-sanitize'; +import MDEditor from '../core/src'; +import MDEditorCommon from '../core/src/index.common'; +import MDEditorNoHighlight from '../core/src/index.nohighlight'; + +const cases = [ + ['doctype and unfinished HTML comment', '