-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(javascript) Incorrect highlight after '/' symbol #2530
Comments
Please confirm you are actually having this problem with the latest release, 10.0.2. |
If you can test #2531, please do. |
Nope that just shifts it, the problem is that value container and attr container are both fighting for this content... |
Where else is the |
Answer: ternary, lol.
Right there in the test file too, LOL. |
FYI: Example 1 should not ben an issue in version 10, can you confirm? |
{ // object attr container
begin: regex.concat(/[{,\n]\s*/,
// we need to look ahead to make sure that we actually have an
// attribute coming up so we don't steal a comma from a potential
// "value" container
regex.lookahead(regex.concat(
// we also need to allow for multiple possible comments inbetween
// the first key:value pairing
/(\/\/.*\s*)*/,
IDENT_RE + '\\s*:'))), That's one way to get it done... |
Probably also needs to check multi-line comments. |
Example 1 has an issue in version 10, but example 2 - not:
|
I see the opposite. In version 10 example 1 looks great while example 2 is broken. |
This fixes an issue where things were incorrectly highlighted after the '/' symbol in javascript [1]. This also includes other fixes to the java language, c language and php language. [1] highlightjs/highlight.js#2530 Bug: Issue 12726 Change-Id: I7fe08646e2698fc3f4e6025cf7a4201565a84635
Describe the issue
In some cases, the highlight is not correct after the '/' symbol.
Bellow is 2 examples.
Which language seems to have the issue?*
javascript
Are you using
highlight
orhighlightAuto
?highlight
Sample Code to Reproduce
Example 1:
Example 2:
Expected behavior
In the example 1, the text after the '/' symbol doesn't change highlight color (including the symbol itself)
In the example 2 highlight after regexp must be correct
Additional context
It seems, problem appears in 9.18.1. I can't reproduce the problem with 9.18.2
The text was updated successfully, but these errors were encountered: