-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Link elements do not follow anchors when these are accentuated #23690
Comments
Closed in favour of remarkjs/remark-slug#12 |
Reopened again, from remarkjs/remark-slug#12 Here there is a minimal repo https://github.com/kuworking/link_anchors_accents The <h1 id="test">no accent</h1>
<h1 id="tést">yes accent</h1> <p>
<Link to="/page-2#test">Go to page 2, no accent, works</Link>
</p>
<p>
<Link to="/page-2#tést">Go to page 2, yes accent, doesn't follow the anchor</Link>
</p> |
@kuworking Thanks for reporting. I spent some time yesterday looking into this and have absolutely reproduced it. To document my findings here is a few things: In a native HTML page
In Gatsby
I haven't identified yet if this is a Gatsby problem, or with @reach/router, but there is definitely an inconsistency here and we'd like to align with the platform. |
I figured out what the problem is, the browser encodes the hash, so when we try to compare the hash to the id in the page they do not match. Browsers must internally decode that hash, but we currently don't. I know how to fix this now, just need to figure out if we should fix this in gatsby, or if it should be fixed in @reach/router. But making progress! |
What can I say, apart from thanks a lot 👏👏👏👏👏 |
Fixed in latest! |
If in a mdx file I have something like
and later I grab the
tableOfContents
through graphQL, I can see thattableOfContents.items[].node.url
and theid
property passed to theh1
node has the accentThe link you can recreate with
"to="mywebpage#This-is-my-áccentuated-title"
doesn't go to the anchor because of the accent (at least what I'm seeing in Chrome)One easy workaround would be to just remove accents when creating the
id
names, but AFAIK it cannot be done by the user (?)The text was updated successfully, but these errors were encountered: