Markdown link reference comments render as visible text in docs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- markdown, typescript
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Bắt đầu bằng cách xác định phần xử lý định nghĩa tham chiếu liên kết trong @tanstack/markdown và tái hiện vấn đề với trang tài liệu TanStack Query bị ảnh hưởng. Xác minh rằng các định nghĩa có đích đến và tiêu đề bị bỏ qua khỏi đầu ra được render, bao gồm cả dạng [//]: # 'SomeLabel', trong khi các tham chiếu liên kết thông thường vẫn được render chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Markdown comments written as link reference definitions with titles are rendering as visible text on the TanStack docs site.
For example, comments like this:
[//]: # 'SomeLabel'
appear visibly in the rendered docs page, but they are correctly hidden when previewing the same Markdown file on GitHub.
Affected scope
Any docs page generated from Markdown files that contain link reference comments with titles, for example:
https://tanstack.com/query/latest/docs/framework/react/guides/queries
This pattern appears to be used across many docs files, so the issue is not limited to a single page.
Expected behavior
The line should be parsed as a CommonMark link reference definition and omitted from rendered output, matching GitHub's Markdown preview behavior.
Actual behavior
The line is rendered as visible text in the docs page.
Why this matters
This pattern is used throughout the docs as invisible labels/anchors. In TanStack Query docs alone, many files use this syntax, so the issue can show up across multiple docs pages.
Likely root cause
The docs site appears to use @tanstack/markdown for parsing. Its link reference definition handling currently appears to only match definitions where the destination is the final token on the line:
const definition = line.match(/^ {0,3}\[([^\]\n]+)\]:[ \t]*(\S+)[ \t]*$/);
That does not match this valid CommonMark form:
[//]: # 'SomeLabel'
In this case, # is the destination and 'SomeLabel' is the optional title.
Suggested fix
Allow link reference definitions to include an optional title, matching CommonMark behavior:
const definition = line.match(
/^ {0,3}\[([^\]\n]+)\]:[ \t]*(\S+)(?:[ \t]+"[^"]*"|[ \t]+'[^']*'|[ \t]+\([^)]*\))?[ \t]*$/,
);
This would parse the example as a link reference definition and prevent it from being rendered as visible docs text.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.1k
- Fork
- 401
- Merge trung bình
- 18 giờ 44 phút
- Pull request đã merge (30 ngày)
- 55
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/tanstack.com
-
source-audit
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
TanStack/tanstack.com#1195 ·
-
source-audit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
TanStack/tanstack.com#1194 · 2 bình luận ·
-
source-audit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TanStack/tanstack.com#1177 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
TanStack/tanstack.com#1059 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
TanStack/tanstack.com#1047 ·
Tất cả issue của TanStack/tanstack.com
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100