facebook / facebook/docusaurus

Normalize heading ids / anchors / hash to lowercase?

Abierto
#9,663 10 comentarios 0 reacciones 0 asignados Ver en GitHub
proposal
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.