Skip to content

(Rust) highlighting breaks after backslash char literal ('\\') #4351

@kerpleplop

Description

@kerpleplop

Describe the issue
Syntax highlighting breaks in Rust when using a backslash char literal (\\). Code following this backslash looks to be highlighted as text instead of code.

Which language seems to have the issue?
Rust

Are you using highlight or highlightAuto?
highlight

Sample Code to Reproduce
https://jsfiddle.net/fqzncedv/5/

if  text.contains('\\') || text.contains('/') {
    println!("found a slash");
}
Image

Expected behavior
Lines following the text.contains('\\') expression should retain normal syntax highlighting.

Additional context
highlight.js latest version (11.11.1)

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