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

Support anchor links in README files #824

Closed
daveverwer opened this issue Nov 27, 2020 · 0 comments · Fixed by #1090
Closed

Support anchor links in README files #824

daveverwer opened this issue Nov 27, 2020 · 0 comments · Fixed by #1090
Assignees
Labels
bug Something isn't working

Comments

@daveverwer
Copy link
Member

See the Alamofire README for a great example of this. The table of contents at the start is full of relative links that don't work because the headings do not have id attributes, or anchors further down the document.

I don't think this is (easily) fixable client side, and I think it should probably be the responsibility of the Markdown parser. The way it works on GitHub is that the Markdown automatically generates anchor elements:

So, in the README.md, the heading for Donations is a simple heading:

Screenshot 2020-11-27 at 15 32 26@2x

The HTML generated looks like this:

Screenshot 2020-11-27 at 15 31 20@2x

It uses hyphens for spaces and lowercases everything. For example, the Resolved Radars generates this:

Screenshot 2020-11-27 at 15 32 53@2x

There are probably some more rules that I'm not considering, like apostrophes and other special characters.

Ideally, this would be an option on the GFM parser we're using. Let's check that before we implement anything custom.

Follow-on from #410

@daveverwer daveverwer added the bug Something isn't working label Nov 27, 2020
@daveverwer daveverwer changed the title Support relative/anchor links in README files Support anchor links in README files Dec 24, 2020
@daveverwer daveverwer self-assigned this May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant