From 082572bef37061d23cc8a606c18960d54be3d177 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:01:58 +0530 Subject: [PATCH] fix regex to ignore html tag in editor output --- src/app/components/editor/output.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/editor/output.ts b/src/app/components/editor/output.ts index 1fb2d590..9a03604c 100644 --- a/src/app/components/editor/output.ts +++ b/src/app/components/editor/output.ts @@ -69,7 +69,7 @@ const elementToCustomHtml = (node: CustomElement, children: string): string => { } }; -const HTML_TAG_REG = /<([\w-]+)(?:[^/>]*)(?:(?:\/>)|(?:>.*?<\/\1>))/; +const HTML_TAG_REG = /<([\w-]+)(?: [^>]*)?(?:(?:\/>)|(?:>.*?<\/\1>))/; const ignoreHTMLParseInlineMD = (text: string): string => { if (text === '') return text; const match = text.match(HTML_TAG_REG);