Link to possible platforms.
Linking to part of the same document in Markdown (via: Stack Overflow)
Posted by jpluimers on 2016/02/22
I love markdown, but it lacks the ability to directly create destination anchors (but MarkDownExtra however does for headers)
Anchors can be used to link within and between documents, the foundation of web navigation, and also very important inside documentation.
Luckily, Markdown allows inline HTML, so you can add an HTML destination anchor: an a element with either a name or id attribute.
XHTML deprecated the name attribute, but you should actually use it. The reason is that in HTML5, most browsers create a global JavaScript variable for each id id anchor.
In addition, you should not use a self closing a element: only XHTML supports that.
So the Markdown then becomes something like this:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## <a name='possiblePlatforms'>Possible platforms</a> | |
| Link to [possible platforms](#possiblePlatforms). |
In the heading, you will see the html for the destination anchor, in the link you will see the MarkDown for the internal source anchor..
The above example will render like this:
–jeroen
via: How to link to part of the same document in Markdown? – Stack Overflow.






Leave a comment