Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Grammars:
- 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][]
- enh(js/ts) improve `CLASS_REFERENCE` (#3411) [Josh Goebel][]
- fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][]
- fix(clojure) `comment` macro catches more than it should (#3395)
- fix(clojure) `$` in symbol breaks highlighting
Expand Down
8 changes: 6 additions & 2 deletions src/languages/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,14 @@ export default function(hljs) {
regex.either(
// Hard coded exceptions
/\bJSON/,
// Float32Array
/\b[A-Z][a-z]+([A-Z][a-z]+|\d)*/,
// Float32Array, OutT
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
// CSSFactory
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+/,
// FPs
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*/,
// P
// single letters are not highlighted
// BLAH
// this will be flagged as a UPPER_CASE_CONSTANT instead
),
Expand Down
3 changes: 3 additions & 0 deletions test/markup/javascript/class.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
<span class="hljs-title class_">CSSParser</span>
<span class="hljs-title class_">Float32Array</span>
<span class="hljs-title class_">BigInt64Array</span>
<span class="hljs-title class_">FPs</span>
<span class="hljs-title class_">OutT</span>
<span class="hljs-title class_">InT</span>
3 changes: 3 additions & 0 deletions test/markup/javascript/class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ SelfDrivingTruck
CSSParser
Float32Array
BigInt64Array
FPs
OutT
InT