You can link to an anchor heading in markdown quite easily.[link to anchor heading](#background)
Plenty of stackoverflow questions deal with it such as this one or this one.
But I cannot seem to find a way to link to anchors that share the same name but are in different sections.
So for example, I cannot link to the background section in a different section.[link to database background](#database#background)
As opposed to say :[link to front end background](#front-end#background)
This does not work either.[link to database background](#database##background)
I would expect the markdown anchor link to follow the section path specified. Is this not possible? Or am I using the wrong syntax?
Just follow the [text](#link) syntax and follow these guidelines: write the letters and numbers as they are. replace spaces with dashes - remove the rest of the characters.
Explicit anchors can be inserted anywhere in the document using <a name="tag"></a> or {#tag} . Implicit anchors are automatically created for each heading. For example ## Section 1 will have the anchor Section-1 .
To create a link between pages, type in the name of your link between brackets "[ ]". As you start typing, internal page link options will appear.
As stated in the Markdown Guide, some applications allow you to use HTML tags in Markdown-formatted text (e.g. GitHub). Check your Markdown application's documentation to be sure.
If HTML is allowed, you can use the following:
# Front end
- [Background](#front-end-background)
<h2 id="front-end-background">Background</h2>
# Database
- [Background](#database-background)
<h2 id="database-background">Background</h2>
In the example above, <h2>
is the same as ##
. It also works with other headings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With