microsoft / microsoft/vscode-markdown-languageservice
Link detection is not robust
@mjbvz is already working on this.
Since Dec 13, 2024.
- Dominant language
- TypeScript
- Stars
- 438
- Forks
- 25
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 1
Description
Link detection currently uses some terrible regular expressions to find document links. This leads to links incorrectly being detected when they should not be, as well as us missing some potential links. The upside is that the regular expression are pretty fast
Ideally we should instead get the link data from the markdown AST. However markdown-it currently doesn't provide line,column data for link tokens (or even file offsets, unless I've missed something)
I previously explored using tree sitter for this but performance wasn't acceptable. Not sure if that's a fundamental issue or something we could fix. Having the position data from markdown-it though would be a better solution
Relevant issues:
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.