highlight.js
highlight.js copied to clipboard
(Crystal) formats integer divison incorrectly
Describe the issue
Using //
in crystal will make the highlighter mark the rest of the file.
In crystal is //
used for integer division.
Code:
def something()
something // 4
end
Which language seems to have the issue? Crystal
Are you using highlight
or highlightAuto
?
highlight
Sample Code to Reproduce
def something()
something // 4
end
Expected behavior The expected behavior is to not mark the rest of the code with the color green.
Additional context Nope
The trick here would probably be to introduce a new mode rule that only matches the literal //
(with no scope, so as not to color it)... we only want to prevent It from being mis-recognized by the regex mode rule.
Yeah, to be a valid regex it needs to be at least 1 character between the // otherwise it is invalid and is thereby integer divison
Hi, I want to contribute but I don't know how to add crystal
in tools/developer.html
to test. Anyone can help me out?
./build -t browser crystal
or additive:
./build -t browser :common crystal