JavaScript regular expression literal + single-line comment = incorrect syntax-highlighting
Open
Nobody has claimed this yet.
bug
core
language-definitions
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Information:
- Prism version: latest (v1.28.0)
- Plugins: none
- Environment: all
Example
/./g; // remove this comment to fix the highlighting
/./g;
The first regular expression literal gets syntax-highlighted correctly. The second one doesn’t. Removing the comment at the end of the first line makes both get syntax-highlighted correctly.
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 with the JavaScript example in the issue and reproduce it in the linked Prism test page, comparing the two regular-expression literals with and without the trailing single-line comment. Done means both literals are highlighted correctly while preserving the comment behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100