-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Description
Describe the issue
Syntax highlighting changes halfway through a Python identifier _undef to look like the def keyword.
Which language seems to have the issue?
python
Are you using highlight or highlightAuto?
I don't know what that means. I assume it's about how highlight.js is deployed, but I'm an end user, not a Stack Exchange dev.
Sample Code to Reproduce
foo = _undef
barhttps://jsfiddle.net/td6a2fhg/
Expected behavior
GitHub gets it right.
All other syntax highlighters I checked don't seem to highlight anything.
Additional context
- This issue started with 11.0.0 and does not exist in 10.7.3
- I noticed the problem "in the wild" on this Stack Overflow answer.
- The HTML output from the fiddle:
<code class="python lang-python hljs language-python">foo = _un<span class="hljs-keyword">def</span> <span class="hljs-title function_">bar</span> </code>
- The issue doesn't occur when the identifier is followed by a different token, like a literal:
foo = _undef []
