You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inline HTML comments are output as visible text #466
An HTML comment on its own line becomes a comment node, which is correct (see SPEC/COMARK/comment.md). An HTML comment inside a line of text becomes part of the text, so renderers show <!-- note --> to the reader.
Input
Hello <!-- note --> world
Actual output
<p>Hello <!-- note --> world</p>
The reader sees: Hello <!-- note --> world.
Expected output
<p>Hello <!-- note --> world</p>
The reader sees: Hello world. This matches GitHub and @nuxtjs/mdc.
Additional context
This is a regression from @nuxtjs/mdc, which parses the inline comment as a comment node, so migrated documents keep the comment invisible.
The same behavior was verified in a Nuxt 4.5.2 app using @comark/nuxt 0.7.0, both client-side and in SSR output.
Logs
Not applicable; the reproduction above shows the full output.
Hi! I looked into this. On current main the parser already turns inline comments into comment nodes (fixed by the refactor in #401), so this mainly affects the published 0.7.0. There's a related bug still on main: when the AST is stringified back to Markdown, an inline comment gets a block separator after it, so Hello <!-- note --> world becomes two paragraphs. I'll open a PR to fix this.
Activity
0froq commentedon Oct 19, 2026
Hi! I looked into this. On current
mainthe parser already turns inline comments into comment nodes (fixed by the refactor in #401), so this mainly affects the published 0.7.0. There's a related bug still onmain: when the AST is stringified back to Markdown, an inline comment gets a block separator after it, soHello <!-- note --> worldbecomes two paragraphs. I'll open a PR to fix this.fix(stringify): keep inline HTML comments inside their paragraph