Skip to content

Again: Ruby syntax: Wrong recognition of symbols at the place of calling a class methods. Now in v11.12.0 #4516

Description

@Sega100500

I already wrote about this issue for version v11.11.1, the issue was closed, but the bug still remains.

Wrong recognition of symbols Ruby at the place of calling a class methods.
Class methods may be call via:
ClassName::method
but it recognized as symbol :method, also now ClassName: reconized as a symbol.

Which language seems to have the issue?
Ruby

Are you using highlight or highlightAuto?

document.querySelectorAll('pre').forEach((el) => {
  hljs.highlightElement(el);
});

Sample Code to Reproduce
:symbol
symbol:
A::a - call class method

To fix the bug:

Just replace
':(?!\\s)' to '(?<!:):(?!\\s)'
and
'(!|\\?)?:' to '(!|\\?)?:(?!:)'

Is it really that hard to do? The bug came from the previous version and was not fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions