-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Github-flavored Markdown anchors/id scheme #2821
Comments
+++ Rafael Kitover [Mar 27 16 08:24 ]:
SHOULD, according to what? See the documentation for the |
github makes the anchor I'm using doctoc for this at the moment, which makes the right TOC links. |
Is the algorithm github uses for generating automatic +++ Rafael Kitover [Mar 27 16 12:38 ]:
|
I have only found this: http://stackoverflow.com/questions/2822089/how-to-link-to-part-of-the-same-document-in-markdown and this: https://gist.github.com/asabaylus/3071099 it seems that the section heading is separated into words, lowercased, and the words are separated with dashes. pandoc does almost the same thing, but in the case of commandline options like |
If I recall, the motivation for this was that id attributes in HTML 4 had to begin with a letter, and so couldn't begin with a hyphen. This has been relaxed in HTML 5 (which GitHub is targeting). We use a single automatic identifier generating scheme for all formats. Indeed, the identifier is assigned by the reader, which doesn't even know whether the ultimate output is going to be HTML5, HTML4, or both or neither. So it wouldn't be a simple change to allow the hyphen at the beginning of an automatically generated identifier. |
Related issue with headers starting with a number A solution perhaps would be to have the readers allow ids that don't start with a letter, and then do some kind of global transformation in the HTML4 writer. (But then we'd also need to determine whether a similar transformation was needed in other formats, e.g. texinfo and docbook and latex...) |
The relevant function (in Text.Pandoc.Shared) is
|
One option would be a small change to However, this isn't quite enough. If you had |
No dots either (#3655) in GitHub ids. |
We have the same problem.
When convert to any document format, doesn't resolve correctly: Using the markdown_github, trying to convert to html, convert to follow:
Using --toc option, also do the same:
Seeing a odt converted file, the title destination (right-click in the link, modify hyperlink, destination in the document), appear as The GFM does (from github.com), to resolve links:
Here pandoc is removing the first numeration if exist: |
If you have a section heading like:
## -c cmd
It generates the link
#c-cmd
but it SHOULD generate the link#-c-cmd
, so the link does not work.The command is being run with
-t markdown_github
.The text was updated successfully, but these errors were encountered: