Open
Conversation
alythobani
commented
May 18, 2025
| @@ -0,0 +1,19 @@ | |||
| { | |||
| "cSpell.words": [ | |||
Contributor
Author
There was a problem hiding this comment.
Just getting rid of a bunch of spellcheck warnings in main.ts
alythobani
commented
May 18, 2025
| "scripthost", | ||
| "ES2020" | ||
| ] | ||
| "lib": ["dom", "scripthost", "ES2020"] |
Contributor
Author
There was a problem hiding this comment.
Just prettier doing some auto formatting
alythobani
commented
May 18, 2025
Comment on lines
-4
to
-6
| const WIKILINK_REGEX_STRING = "\\[\\[.*?\\]\\]"; | ||
| const MARKDOWN_LINK_REGEX_STRING = "\\[.*?\\]\\(.*?\\)"; | ||
| const URL_REGEX_STRING = "\\w+://\\S+"; |
Contributor
Author
There was a problem hiding this comment.
The new regexes are now built as actual regexes from the start (instead of just strings) so that they only need half as many backslashes
esm7
approved these changes
May 18, 2025
Owner
esm7
left a comment
There was a problem hiding this comment.
Thank you, this is a great contribution!
Contributor
Author
|
For sure, I was meaning to get around to this fix at some point :) Thanks to you for making the plugin in the first place! It's been great |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #242
This PR adjusts the existing link patterns to be more precise and accurate (e.g. take backslashes into account when interpreting brackets as part of link syntax) - and in the context of #242, we now disallow unescaped square brackets inside the
[display text]part of a[display text](url)markdown link.This fixes the issue of a checkbox's square brackets (e.g.
- [ ]/- [x]) being considered as the start of a markdown link when a markdown link is part of the checkbox item (e.g.- [ ] This is a [markdown link](https://some-url.com)).Detailed docstrings have been added to the regexes now that they're even more complex than they were before and some intentional tradeoffs were taken (particularly for
MARKDOWN_LINK_REGEX).This PR also along the way:
vitesttest framework and adds unit tests for the link regexes (jumpToLink.test.ts)package-lock.jsonfrom.gitignoreand adds it to the repo's git tracking (generally considered good practice to commitpackage-lock.json)