diff --git a/CHANGES.md b/CHANGES.md index ecddb0436..2be301a67 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Changes -## 3.15.0 (2026-03-XX) +## 3.15.0 (2026-04-XX) ### Development @@ -18,6 +18,7 @@ This version of the Markdown package has fixed the following issues: - Strip leading and trailing spaces for `inlineHtmlComment` renderers. (#635) - Specify `.value_required:n = { true }` for all options that require values. (discovered by @michal-h21 in #615, fixed in #640) +- Parse the content of inline HTML comments. (described in #641, fixed in #642) ### Continuous integration diff --git a/markdown.dtx b/markdown.dtx index 004b32f8f..9993ae9db 100644 --- a/markdown.dtx +++ b/markdown.dtx @@ -32155,8 +32155,7 @@ parsers.html_comment parsers.html_inline_comment = (parsers.html_comment_start / "") * -P(">") * -P("->") - * Cs(( V("NoSoftLineBreakEndline") - + parsers.any + * Cs(( parsers.any - parsers.nested_breaking_blank - parsers.html_comment_end)^0) * (parsers.html_comment_end / "") @@ -32357,8 +32356,7 @@ parsers.html_any_block = parsers.html_any_block_opening parsers.html_inline_comment_full = parsers.html_comment_start * -P(">") * -P("->") - * Cs(( V("NoSoftLineBreakEndline") - + parsers.any - P("--") + * Cs(( parsers.any - P("--") - parsers.nested_breaking_blank - parsers.html_comment_end)^0) * parsers.html_comment_end @@ -34283,6 +34281,7 @@ end if options.htmlOutput == "commonmark" then parsers.InlineHtml = Cs(parsers.html_inline_comment) + / self.parser_functions.parse_inlines_no_html / writer.inline_html_comment + Cs(parsers.html_any_empty_inline_tag) / writer.inline_html_empty_tag @@ -34298,6 +34297,7 @@ end / writer.inline_html_close_tag else parsers.InlineHtml = Cs(parsers.html_inline_comment) + / self.parser_functions.parse_inlines_no_html / writer.inline_html_comment + Cs( parsers.html_any_empty_inline_tag + parsers.html_inline_instruction diff --git a/tests/testfiles/regression/github/issue-641.test b/tests/testfiles/regression/github/issue-641.test new file mode 100644 index 000000000..8b7a055a0 --- /dev/null +++ b/tests/testfiles/regression/github/issue-641.test @@ -0,0 +1,7 @@ +<<< +foo +>>> +BEGIN document +inlineHtmlComment: bar(softLineBreak)(emphasis: baz) +END document