Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Grammars:

- fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][]
- fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][]
- enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][]
- enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][]
Expand All @@ -22,6 +23,7 @@ Developer Tools:
[Richard Gibson]: https://github.com/gibson042
[Bradley Mackey]: https://github.com/bradleymackey
[Björn Ebbinghaus]: https://github.com/MrEbbinghaus
[Josh Goebel]: https://github.com/joshgoebel

## Version 11.3.1

Expand Down
6 changes: 3 additions & 3 deletions src/languages/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default function(hljs) {
hljs.HASH_COMMENT_MODE,
{
match: [
/def/, /\s+/,
/\bdef/, /\s+/,
IDENT_RE,
],
scope: {
Expand All @@ -397,14 +397,14 @@ export default function(hljs) {
variants: [
{
match: [
/class/, /\s+/,
/\bclass/, /\s+/,
IDENT_RE, /\s*/,
/\(\s*/, IDENT_RE,/\s*\)/
],
},
{
match: [
/class/, /\s+/,
/\bclass/, /\s+/,
IDENT_RE
],
}
Expand Down
5 changes: 5 additions & 0 deletions test/markup/python/false_positives.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
foo = _undef
bar

booger = _unclass
burger
5 changes: 5 additions & 0 deletions test/markup/python/false_positives.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
foo = _undef
bar

booger = _unclass
burger