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

Broken anchor links for headings with special characters in their ids #1892

Closed
mcmd opened this issue Apr 15, 2019 · 2 comments · Fixed by #2045
Closed

Broken anchor links for headings with special characters in their ids #1892

mcmd opened this issue Apr 15, 2019 · 2 comments · Fixed by #2045
Assignees

Comments

@mcmd
Copy link

mcmd commented Apr 15, 2019

Description of the issue found on ampproject.org

Please provide:

The anchor links on the ToC on the right side do not work.

image

For instance, for the Last link ("Example 2: Canonical + Alternate + AMP"), the link is:
https://amp.dev/documentation/examples/guides/internationalization/?referrer=ampbyexample.com#example-2-canonical-alternate-amp

But it should be:
https://amp.dev/documentation/examples/guides/internationalization/?referrer=ampbyexample.com#example-2:-canonical-+-alternate-+-amp

How do we reproduce the issue?

Please provide the steps to reproduce the issue:

  1. Navigate to the Internationalization page
  2. Click on "Example 2: Canonical + Alternate + AMP" in the Table of Contents
  3. Link doesn't work

What browser are you using? Version 73.0.3683.103 (Official Build) (64-bit)
What O/S are you using? macOS 10.13.6 (17G6030)

@mcmd
Copy link
Author

mcmd commented Apr 15, 2019

This iis happening also in the Using the Google AMP Cache article, with the "Redirect & Error Handling" Element in the ToC. It seems like there is a mismatch between the id of the elements in the page and the anchor link used in the ToC when there are special characters ('&' in this particular case, ':' in the original post)

A third example (also with a '&' in the id of the element) would be in the Product Browse Page article, with the "Offers & highlights" link in the ToC

@mcmd mcmd changed the title Broken anchor links on internationalization article Broken anchor links for headings with special characters in their ids Apr 15, 2019
@mcmd
Copy link
Author

mcmd commented Apr 15, 2019

Changing title to "Broken anchor links for headings with special characters in their ids" as this seems to be a site-wide issue with the generation of the anchor links when the headings's ids contain special characters.

@keevcodes keevcodes self-assigned this Apr 15, 2019
@matthiasrohmer matthiasrohmer assigned tharders and unassigned keevcodes May 8, 2019
tharders pushed a commit to tharders/amp-by-example that referenced this issue May 8, 2019
Header id generation should match the grow logic.
All characters but whitespace are allowed
See ampproject/amp.dev#1892
And grow/grow@62d0a6a#diff-506b8f06fee5ce1722a3c180ab3919b7
tharders added a commit to tharders/amp-by-example that referenced this issue May 9, 2019
Header id generation should match the grow logic.
All characters but whitespace are allowed
See ampproject/amp.dev#1892
And grow/grow@62d0a6a#diff-506b8f06fee5ce1722a3c180ab3919b7
sebastianbenz pushed a commit to ampproject/amp-by-example that referenced this issue May 9, 2019
Header id generation should match the grow logic.
All characters but whitespace are allowed
See ampproject/amp.dev#1892
And grow/grow@62d0a6a#diff-506b8f06fee5ce1722a3c180ab3919b7
sebastianbenz added a commit that referenced this issue May 9, 2019
tharders added a commit to tharders/amp-by-example that referenced this issue Nov 5, 2019
Header id generation should match the grow logic.
All characters but whitespace are allowed
See ampproject/amp.dev#1892
And grow/grow@62d0a6a#diff-506b8f06fee5ce1722a3c180ab3919b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants