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

Normalize heading ids / anchors / hash to lowercase? #9663

Open
1 of 2 tasks
slorber opened this issue Dec 22, 2023 · 1 comment
Open
1 of 2 tasks

Normalize heading ids / anchors / hash to lowercase? #9663

slorber opened this issue Dec 22, 2023 · 1 comment
Labels
proposal This issue is a proposal, usually non-trivial change

Comments

@slorber
Copy link
Collaborator

slorber commented Dec 22, 2023

Have you read the Contributing Guidelines on issues?

Motivation

Docusaurus anchor links are currently case sensitive (noticed by implementing the anchor broken link checker: #9528)


Yet, many other sites implement case-insensitive anchors, and those links will usually work:

Note: this is not standard browser behavior, the links won't work with JavaScript disabled.


So: should we also implement this?

Considering this is a non-native behavior, it remains better for progressive enhancement to have correct case-sensitive links in the first place.

Should we report links with incorrect case in the anchor broken link checker?
(this won't block #9528 but we can do a follow-up PR)

Self-service

  • I'd be willing to do some initial work on this proposal myself.
@slorber slorber added the proposal This issue is a proposal, usually non-trivial change label Dec 22, 2023
@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Dec 24, 2023

I'm +0.5 on this if other tools do the same. However, what if a page has two anchors with different casing? The thing that comes to mind is our write-heading-ids CLI which has an opt-in --maintain-case option, but this can also happen with hand-written ids.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue is a proposal, usually non-trivial change
Projects
None yet
Development

No branches or pull requests

2 participants