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 22
33Core Grammars:
44
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
66
77
88## Version 11.11.1
Original file line number Diff line number Diff line change @@ -11,12 +11,7 @@ export default function(hljs) {
1111 const regex = hljs . regex ;
1212 const RUBY_METHOD_RE = '([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)' ;
1313 // 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 ] * / ;
2015 const CLASS_NAME_WITH_NAMESPACE_RE = regex . concat ( CLASS_NAME_RE , / ( : : \w + ) * / )
2116 // very popular ruby built-ins that one might even assume
2217 // are actual keywords (despite that not being the case)
Original file line number Diff line number Diff line change 11<span class="hljs-title class_">Class</span>
22<span class="hljs-title class_">ClassName</span>
33<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 11Class
22ClassName
3- Class_Name
3+ Class_Name
4+ ClassNAME
You can’t perform that action at this time.
0 commit comments