This is implemented using a link label (link label), which is not associated with any link. These link shortcuts will be cut when exporting:
(пустая строка) [comment]: # (comment text) (пустая строка) [//]: # (comment text)
Compare with the usual link syntax:
[link text][label] [label]: http://ru.stackoverflow.com/questions/ask
In principle, the Markdown specification allows for the option when there is no empty line before the comment, and <> used instead of # . The problem is that the specification is leaky like a sieve, and the existing 28+ implementations work differently. Welcome to Markdown!
The Babelmark2 toolkit, which checks the rendering of Markdown markup in various implementations, will help us check the performance of various implementations. ( + - passed the test, - - did not pass ? - leave non-displayable garbage in HTML).
According to the test, the most platform-independent option is # and the empty line before the comment. An empty line after the comment does not matter. In particular, the increasingly common CommonMark specification , which Jeff Atwood participates in the development, works with this option (and does not work with <> and / or without a blank line)
With these implementations, there is no way to use such comments:
- cebe / markdown 1.1.0
- cebe / markdown MarkdownExtra 1.1.0
- cebe / markdown GFM 1.1.0
- s9e \ TextFormatter (Fatdown / PHP)
The study is based on the solution proposed by Magnus on SO.EN.