stream-markdown-parser 0.0.58-beta.4 → 0.0.58-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7324,9 +7324,12 @@ function applyFixHtmlInlineTokens(md, options = {}) {
7324
7324
  if (t.type === "html_block") {
7325
7325
  const rawContent = String(t.content || "");
7326
7326
  const tag = (rawContent.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1] ?? "").toLowerCase();
7327
- if (!/^\s*<\s*\//.test(rawContent)) {
7327
+ const isClosingTag$1 = /^\s*<\s*\//.test(rawContent);
7328
+ if (!tag || !customTagSet.has(tag)) continue;
7329
+ if (!isClosingTag$1) {
7328
7330
  if (tag) {
7329
- if (!new RegExp(`<\\s*\\/\\s*${tag}\\s*>`, "i").test(rawContent)) tagStack.push([tag, i]);
7331
+ const closeRe = new RegExp(`<\\s*\\/\\s*${tag}\\s*>`, "i");
7332
+ if (!new RegExp(`^\\s*<\\s*${tag}\\b[^>]*\\/\\s*>`, "i").test(rawContent) && !closeRe.test(rawContent)) tagStack.push([tag, i]);
7330
7333
  }
7331
7334
  } else if (tagStack.length > 0 && tag && tagStack[tagStack.length - 1][0] === tag) {
7332
7335
  const [, openIndex] = tagStack[tagStack.length - 1];