Skip to content

Commit 169267e

Browse files
committed
fix(ruby): highlight entire class names with underscore
Signed-off-by: jimtng <[email protected]>
1 parent d301848 commit 169267e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/languages/ruby.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export default function(hljs) {
1212
const RUBY_METHOD_RE = '([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)';
1313
// TODO: move concepts like CAMEL_CASE into `modes.js`
1414
const CLASS_NAME_RE = regex.either(
15-
/\b([A-Z]+[a-z0-9]+)+/,
15+
/\b([A-Z]+[a-z0-9_]+)+/,
1616
// ends in caps
17-
/\b([A-Z]+[a-z0-9]+)+[A-Z]+/,
17+
/\b([A-Z]+[a-z0-9_]+)+[A-Z]+/,
1818
)
1919
;
2020
const CLASS_NAME_WITH_NAMESPACE_RE = regex.concat(CLASS_NAME_RE, /(::\w+)*/)

0 commit comments

Comments
 (0)