Markdown footnotes incorrectly recognized as URL references
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Information:
- Prism version: 1.29.0
- Plugins: none
- Environment: Browser
Description
Markdown footnotes are incorrectly recognized as URL references, e.g., the text [^1]: This in the example below:
A footnote[^1].
[^1]: This is a footnote and not a URL.
I think the regex here needs to be enhanced: https://github.com/PrismJS/prism/blob/59e5a3471377057de1f401ba38337aca27b80e03/components/prism-markdown.js#L150-L154
Example
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Inspect components/prism-markdown.js around lines 150-154 and reproduce the example in the linked Prism test page. Adjust the referenced regex so Markdown footnote definitions are not recognized as URL references, while actual URL references still are. Verify the example renders with the corrected Markdown highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100