TanStack / TanStack/tanstack.com
Markdown link reference comments render as visible text in docs
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.1k
- Forks
- 401
- Ø Merge
- 18 Std. 14 Min.
- Gemergte PRs (30 T.)
- 56
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Verarbeitung von Link-Referenzdefinitionen in @tanstack/markdown zu lokalisieren, und reproduziere das Problem mit der betroffenen TanStack Query-Dokumentationsseite. Überprüfe, dass Definitionen mit Zielen und Titeln in der gerenderten Ausgabe weggelassen werden, einschließlich der Form [//]: # 'SomeLabel', während gewöhnliche Link-Referenzen weiterhin korrekt gerendert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- markdown, typescript
- Bereich
- documentation, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 76/100