Fix regex to ignore html tag in editor output (#1515)

This commit is contained in:
Ajay Bura 2023-10-29 22:42:05 +11:00 committed by GitHub
parent a2cbe79787
commit a98903a85b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);