regex highlighting
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 245
- Forks
- 80
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 2
Description
The lines:
/a[a-z]{2,4}?/.exec("abcdefghi")
/(aa|aabaac|ba|b|c)*/.exec("aabaac")
/(z)((a+)?(b+)?(c))*/.exec("zaacbbbcac")
/(a*)*/.exec("b")
/(a*)b\1+/.exec("baaaac")
are highlighted oddly, because the <span class="hljs-regexp">...</span> markup is surrounding the wrong text.
In contrast, the line:
"aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(/^(a+)\1*,\1+$/,"$1")
has the regex correctly highlighted.
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.
Research direction
Start with the five regex examples in the issue and compare their generated span boundaries with the correctly highlighted replace example. Trace the regex-highlighting path that produces the markup, then verify that each example wraps only its regex text and not surrounding content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100