uiwjs / uiwjs/react-codemirror
Special characters trailing issue
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
It seems that the PR to fix the slash as a trailing character of the URL didn't fix the issue:
- #756
I have a URL that ends with parenthesis:
https://en.wikipedia.org/wiki/Tree-sitter_(parser_generator)
And the closing parenthesis is not recognized as part of the URL.
The fix is to add all special characters or refactor the whole RegEx.
Potential fix using existing solution:
\b(?:[\/()[\].,;:!?']+)?
Also note that in hash you can put anything. I use a JSON array to keep the state in one of my websites.
https://terminal.jcubic.pl/404#[[0,1,"jargon%20magic"]]
Maybe it's worth using AI to create a full regex. Or use a library that is proven to work. It's also worth adding some tests to verify that the regex works correctly.
As for hash, I would just accept every non-space. Another option is to expose the regex to the user in the option (with the current default value) so the user can change it.
I can help create a PR if you're ok if it will be written by AI (of course, tested).
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
Start by locating the URL-matching regex and the change from issue #756, then inspect how URL parsing is tested. Add regression coverage for URLs ending in a closing parenthesis and hashes containing non-space characters; done means both examples are recognized as intended without breaking existing URL cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100