File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Core Grammars:
4
4
5
- - fix(ruby) highlight entire class name even when it contains underscores
5
+ - fix(ruby) highlight entire class name even when it contains underscores or ends with consecutive caps
6
6
7
7
8
8
## Version 11.11.1
Original file line number Diff line number Diff line change @@ -11,12 +11,7 @@ export default function(hljs) {
11
11
const regex = hljs . regex ;
12
12
const RUBY_METHOD_RE = '([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)' ;
13
13
// TODO: move concepts like CAMEL_CASE into `modes.js`
14
- const CLASS_NAME_RE = regex . either (
15
- / \b ( [ A - Z ] + [ a - z 0 - 9 _ ] + ) + / ,
16
- // ends in caps
17
- / \b ( [ A - Z ] + [ a - z 0 - 9 _ ] + ) + [ A - Z ] + / ,
18
- )
19
- ;
14
+ const CLASS_NAME_RE = / \b ( [ A - Z ] + [ a - z 0 - 9 _ ] + ) + [ A - Z ] * / ;
20
15
const CLASS_NAME_WITH_NAMESPACE_RE = regex . concat ( CLASS_NAME_RE , / ( : : \w + ) * / )
21
16
// very popular ruby built-ins that one might even assume
22
17
// are actual keywords (despite that not being the case)
Original file line number Diff line number Diff line change 1
1
<span class="hljs-title class_">Class</span>
2
2
<span class="hljs-title class_">ClassName</span>
3
3
<span class="hljs-title class_">Class_Name</span>
4
+ <span class="hljs-title class_">ClassNAME</span>
Original file line number Diff line number Diff line change 1
1
Class
2
2
ClassName
3
- Class_Name
3
+ Class_Name
4
+ ClassNAME
You can’t perform that action at this time.
0 commit comments