Github automatically parses anchor tags out of your headers. So you can do the following:
[Custom foo description](#foo)
In the above case, the
Foo header has generated an anchor tag with the name
Note: just one
# for all heading sizes, no space between
# and anchor name, anchor tag names must be lowercase, and delimited by dashes if multi-word.
[click on this link](#my-multi-word-header)
### My Multi Word Header
Works out of the box with
I believe that all the previously proposed solutions (apart from those that require specific implementations) result in the comments being included in the output HTML, even if they are not displayed.
If you want a comment that is strictly for yourself (readers of the converted document should not be able to see it, even with "view source") you could (ab)use the link labels (for use with reference style links) that are available in the core Markdown specification:
[comment]: <> (This is a comment, it will not be included)
[comment]: <> (in the output file unless you use it in)
[comment]: <> (a reference style link.)
Or you could go further:
[//]: <> (This is also a comment.)
To improve platform compatibility (and to save one keystroke) it is also possible to use
# (which is a legitimate hyperlink target) instead of
[//]: # (This may be the most platform independent comment)
For maximum portability it is important to insert a blank line before and after this type of comments, because some Markdown parsers do not work correctly when definitions brush up against regular text. The most recent research with Babelmark shows that blank lines before and after are both important. Some parsers will output the comment if there is no blank line before, and some parsers will exclude the following line if there is no blank line after.
In general, this approach should work with most Markdown parsers, since it's part of the core specification. (even if the behavior when multiple links are defined, or when a link is defined but never used, is not strictly specified).
After doing some research and looking at the markdown convertion, ive noticed that it can be done in such way:
Say for example we have text:
The output of this in Pure text Markup will be:
So to replace the
\nmust only be done inside the