NanoFile

Markdown comments

Markdown has no comment syntax. An HTML comment is the usual way to leave a note in the file that does not appear in the rendered page.

HTML comment
<!-- This note is not rendered. -->
Multi-line
<!--
A longer note.
Still hidden.
-->
For renderers that strip HTML
[comment]: # (This is not rendered either.)

An abused link definition. It never matches a link, so nothing shows.

What usually goes wrong

  • Hidden is not private. The comment sits in the file in plain text, and anyone who opens the source or views the page source can read it.
  • A comment inside a fenced code block is not a comment. It is code, and it renders.
  • Some strict renderers escape HTML comments and print them. The link-definition trick survives those.

Related