Repository navigation
fix(markdown): support HTML comments - #4576
Open
phanirithvij wants to merge 1 commit into
Open
phanirithvij wants to merge 1 commit into
phanirithvij wants to merge 1 commit into
Conversation
CommonMark (§ 4.6) defines HTML comments (<!-- ... -->) as valid Markdown
elements. Previously, markdown.js only matched tags starting with ASCII
letters or underscores in INLINE_HTML, missing `<!--`.
As a result, content inside HTML comments was parsed as raw markdown prose.
Any underscore inside a comment (e.g. `<!-- note_to_self -->` or notebook
metadata comments like `<!-- livebook:{"default_language":"python"} -->`)
would trigger an unclosed `_emphasis_` span, mistakenly italicizing the rest
of the document.
Add `HTML_COMMENT` using `hljs.COMMENT('<!--', '-->')` with zero relevance
to CONTAINABLE and top-level contains.
Assisted-by: Antigravity (Gemini 3.8 Flash high)
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
phanirithvij
force-pushed
the
fix/markdown-html-comments
branch
from
November 3, 2026 08:17
eae5cfa to
c850b2b
Compare
phanirithvij
marked this pull request as ready for review
November 3, 2026 08:35
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CommonMark (§ 4.6) defines HTML comments () as valid Markdown elements.
Changes
Previously, markdown.js only matched tags starting with ASCII letters or underscores in INLINE_HTML, missing
<!--.As a result, content inside HTML comments was parsed as raw markdown prose.
Any underscore inside a comment (e.g.
<!-- note_to_self -->or notebook metadata comments like<!-- livebook:{"default_language":"python"} -->) would trigger an unclosed_emphasis_span, mistakenly italicizing the rest of the document.Add
HTML_COMMENTusinghljs.COMMENT('<!--', '-->')with zero relevance toCONTAINABLEand top-level contains.Checklist