-
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
fix(python) identifiers starting with underscore not highlighted #3221
Conversation
51c73ee
to
791f1f6
Compare
If it's along the lines of #2756 then it's not a high priority and needs some considerable effort and further research. |
That's what I thought too, ECMA 2018 could help here with its unicode category support in RegExp but it is only supported in recent browsers. So yes, this needs considerable effort and testing on the subject. |
We're mostly fine with supporting only more recent browsers. Safari is a hold out on look-behind regex, but we're mostly ES2015/2018 already otherwise in several ways...
If you skim the other issue you'll see the issue is |
Please add changelog entry. |
Since hljs version 11, python identifiers starting with an underscore character were no longer highlighted (regression introduced in 952fa0a). Add new python markup test related to identifiers highlighting.
791f1f6
to
318eda3
Compare
Done. I also updated new markup test with the class starting with an underscore case. |
Thanks so much! |
Hello and thanks for maintaining that great library.
I noticed a regression in
highlightjs.js 11.0
, Python identifiers starting with an underscorecharacter (
__init__
for instance) are no longer highlighted (introduced in 952fa0a).That PR fixes that issue and add new markup tests to cover it.
On a related note, Python 3.0 introduces additional characters from outside the ASCII range for identifiers. Adding support for those in highlight.js is out of that PR scope and does not seem easy to implement but I could try to have a look when I have some time.