Closed JayAndJef closed 4 months ago
Github seems to have it correct.
A simple rule that matches r#*
and applies no scope would fix the issue of false positives here.
I tried applying a new regex in rust.js to solve the problem.
https://regexr.com/
In this regex site
(r#)?[a-zA-Z_]\w*
With this regex, the r# keyword is properly identified in all cases.
It seems to work fine in the test-browser as well.
Describe the issue In rust, one can put
r#
before a keyword name to escape it. Highlight.js does not recognize when this happens and instead highlights the keyword name as a keyword.Which language seems to have the issue? Rust
Are you using
highlight
orhighlightAuto
?highlight
Sample Code to Reproduce
Expected behavior In the above code block,
r#use
should be highlighted as a variable name. Instead,r
is highlighted as a variable name anduse
is highlighted as a keyword.Additional context