Skip to content
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

Different anchor tags for some headings. #11

Open
dmitshur opened this issue Apr 27, 2017 · 0 comments
Open

Different anchor tags for some headings. #11

dmitshur opened this issue Apr 27, 2017 · 0 comments
Labels

Comments

@dmitshur
Copy link
Member

The GitHub API and this Go package generate slightly different anchor tags for headings with periods, and some other sequences of special characters.

This is because of a difference in algorithm for escaping of heading anchor names in GFM when rendered by GitHub API, compared to the behavior of sanitized_anchor_name that this package relies on.

For example, GitHub turns "Date & Time" to "#date--time",
but this package escapes that as "#date-time".

It would be very helpful if there was a formal specification for the algorithm GitHub uses, rather than having to guess what it is. GitHub released a formal spec for GFM, but I couldn't find a section covering this there. I tried asking at https://twitter.com/shurcooL/status/847212011649937408, but no response there.

/cc @dominikh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant