json-schema-org / json-schema-org/website
🐛 Bug: transformMarkdownLinks regex fails on implicit and collapsed reference links
@h30s is already working on this.
Since Feb 22, 2026.
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
Describe the bug
The custom markdown pre-processor transformMarkdownLinks in lib/markdownUtils.ts (used by StyledMarkdown.tsx) uses a regular expression that breaks standard Markdown reference links. Specifically, it fails to parse implicit reference links (like [text][]) and completely ignores collapsed reference links ([text]).
This negatively impacts the authoring experience because contributors writing documentation have to redundantly type out their reference links (e.g., [JSON Schema][JSON Schema]) just to appease the custom parser, deviating from standard Markdown spec behavior.
Steps To Reproduce
- Author or preview any markdown file in the website that uses StyledMarkdown.tsx.
- Add a standard empty bracket reference link:
Here is a [link][]and define it below:[link]: https://example.com - Add a collapsed reference link:
Here is a [link]and define it below. - Render the page.
- See error: The links are not converted to anchor tags; they render as raw text.
Expected Behavior
Both [link][] and [link] should be correctly parsed and converted into standard inline markdown links [link](https://example.com). The regex should fallback to matching the primary text if the secondary ID block is empty or missing.
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
No
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.