facebook / facebook/docusaurus

Normalize heading ids / anchors / hash to lowercase?

Đang mở
#9,663 10 bình luận 0 reaction 0 người được giao Xem trên GitHub
proposal
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.