Markdown has no comment syntax of its own. The HTML comment is the common choice; the link-reference trick works even where HTML is stripped. Either way the text stays in the source file, so never put secrets in a comment.
All ways to write it
HTML comment. Hidden on GitHub and in most renderers. Can span lines.Needs HTML<!-- This is a comment -->
An unused link reference, so nothing renders. Needs a blank line before it.Works everywhere[//]: # (This is a comment)
Example
You type
Shown paragraph.
<!-- TODO: add the screenshot from the 2.0 release -->
[//]: # (Reviewer note: check the numbers in this table)
Another shown paragraph.You get
Shown paragraph.
Another shown paragraph.
Both comments are in the source, and neither appears in the preview.
Questions
Are Markdown comments private?
No. Anyone who opens the raw file sees them, and an HTML comment is also sent in the page source. Use them for notes, not secrets.
Why does my [//]: # comment show up?
It needs a blank line above it and must start at the beginning of the line. Inside a paragraph it is plain text.
Comments in Confluence
Confluence pages have inline comments for review notes, which readers can resolve. Inside a Markdown Macro+ macro, the Markdown source stays editable, so check the live preview to confirm a comment is hidden before you save.