diff --git a/lib/md033.js b/lib/md033.js index a36870b7..e138e512 100644 --- a/lib/md033.js +++ b/lib/md033.js @@ -6,7 +6,7 @@ const { addError, bareUrlRe, forEachLine, unescapeMarkdown } = require("../helpers"); const { lineMetadata } = require("./cache"); -const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:[\s/][^>]*)?)>/g; +const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)(?:\/>|>)/g; const linkDestinationRe = /]\(\s*$/; const inlineCodeRe = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/; // See https://spec.commonmark.org/0.29/#autolinks diff --git a/test/inline_html.md b/test/inline_html.md index 70a98403..e166e6e4 100644 --- a/test/inline_html.md +++ b/test/inline_html.md @@ -21,3 +21,7 @@ Text \` text `` text `` text Text \` text `` text \` text `` text Text \`\` text `` text Text `` text \` text `` text + +## Slash in element name + +Text **\\another\directory\\** text