You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.
We have several pages in a github wiki which use anchors to navigate within a page. In github markdown it looks like this:
[Some text](#header-1) # Header 1
This works fine. If I look at the HTML this leads to on github: <a href="#header-1">Some text</a> <h1><a id="user-content-header-1" class="anchor" href="#header-1" aria-hidden="true"><span class="octicon octicon-link"></span></a></h1>
If I run the same markdown content through showdown, the html it generates is <a href="#header-1">Some text</a> <h1 id="header1">Header 1</h1>
So it seems to have removed the space from the header text to generate its id. As they are no longer matching, the navigation is no longer working. Is there some setting I'm missing?
Thanks!
The text was updated successfully, but these errors were encountered:
The behavior of showdowns generated Ids follows the original markdown.pl, the parser made by markdown's aithor, John Gruber.
This behavior, however, is a bit different from github, which uses a different set of rules, mostly for internal linking and compatibility issues.
Currently you cannot match git hubs behavior.
However it should not be very difficult to implement an option to emulate this.
Do you mind post the list of rules github uses to generate IDS?
Perhaps an easy fix would be to allow a user to provide a parameter with which to replace the non-word characters in the Headers? I think replacing the non-word characters with "-" would already lead to a working solution.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
We have several pages in a github wiki which use anchors to navigate within a page. In github markdown it looks like this:
[Some text](#header-1)
# Header 1
This works fine. If I look at the HTML this leads to on github:
<a href="#header-1">Some text</a>
<h1><a id="user-content-header-1" class="anchor" href="#header-1" aria-hidden="true"><span class="octicon octicon-link"></span></a></h1>
If I run the same markdown content through showdown, the html it generates is
<a href="#header-1">Some text</a>
<h1 id="header1">Header 1</h1>
So it seems to have removed the space from the header text to generate its id. As they are no longer matching, the navigation is no longer working. Is there some setting I'm missing?
Thanks!
The text was updated successfully, but these errors were encountered: