facebook / facebook/docusaurus

Normalize heading ids / anchors / hash to lowercase?

Offen
#9,663 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
proposal
Vorherrschende Sprache
TypeScript
Sterne
66.2k
Forks
10k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
52

Beschreibung

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Motivation

Docusaurus anchor links are currently case sensitive (noticed by implementing the anchor broken link checker: https://github.com/facebook/docusaurus/pull/9528)

- this works: https://docusaurus.io/docs/next#design-principles
- this fails: https://docusaurus.io/docs/next#Design-Principles

---

Yet, many other sites implement case-insensitive anchors, and those links will usually work:
- https://developer.mozilla.org/en-US/docs/Learn/HTML#see_ALSO
- https://www.markdownguide.org/getting-started/#why-use-MARKDOWN
- https://jekyllrb.com/docs/posts/#including-IMAGES-and-resources
- https://www.11ty.dev/docs/languages/javascript/#proMISE

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 https://github.com/facebook/docusaurus/pull/9528 but we can do a follow-up PR)

### Self-service

- [ ] I'd be willing to do some initial work on this proposal myself.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.