Another not-exactly-lovable idea comes from a Stack Overflow discussion on the matter.
[//]: # (Write a comment here)
Basically, a line after a blank line starting with some character between two square brackets, a colon, space-octothorpe-space, and then the comment in parentheses will not display on preview. Easy, right?
This syntax is the standard Markdown formatting for reference-style link labels, but since
[//] doesn’t point to a real link, the content will not be rendered.
A benefit to this approach is that this content will not be in any output at all if you convert from Markdown to another format. (HTML
<!-- comments will still exist in converted outputs.)
Also note that at the top of a page, you can use
Some YAML content
to hide YAML-style metadata.
But I agree, a more markdown-y comment syntax would be lovely.