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 highlighting of code #2449
Comments
Java or JavaScript? Looks like Javascript code to me. |
Aah my bad. Sorry. Its Javascript. |
Can you test this against |
How to test against master if I am using something like this?
|
You'd have to build it from source and test locally. :-| |
Thanks for your help! |
Closing as a dup of #2380 (resolved PR) |
If you can test via NPM: |
Describe the issue
A clear and concise description of what the issue seems to be.
For some reason, its picking up code as regex and thats why coloring it differently.
Which language seems to have the issue?
Please specify exactly which language grammar you are using to highlight (
python
,javascript
, etc.) or specify if you are using auto-detection. If you are using auto-detection please first check to make sure the language you are expecting was properly detected. If Highlight.js misidentifies the type of code - then the highlighting may be entirely incorrect - and there often isn't much we can do about that - auto-detection is only best-effort and can't guess right 100% of the time.JavaScript
Sample Code to Reproduce
Please include text examples of the code that fails to highlight properly or can reproduce the bug. You can attach a screenshot if you'd like, but the code is necessary because we may need to copy/paste it to help resolve the issue - or add it to a test.
A jsfiddle can sometimes be even better. You can fork an example test case:
https://jsfiddle.net/ajoshguy/gfzujpyt/
Expected behavior
A clear and concise description of what you expected to happen. A screenshot might help here if another highlighting library gets it right, or is Github highlights it better/properly you can use a GitHub code block.
The font in green should be black too.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: