highlightjs/highlight.js

(Rust) Escaped double quotations in string at attribute are not highlighted properly

Chiusa

#3817 aperta il 10 lug 2023

 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (3497 fork)batch import
buggood first issuehelp welcomelanguage

Metriche repository

Star
 (22.960 stelle)
Metriche merge PR
 (Merge medio 6m) (2 PR mergiate in 30 g)

Descrizione

Describe the issue

Escaped double quotations in string at attributes are not treated as a escaped character but a normal quotation.

Which language seems to have the issue?

Rust

Sample Code to Reproduce

#[derive(ThisError)]
enum MyError {
  #[error("\" appears in a string")]
  UnexpectedDoubleQuote
}

fn main() {}

sample at jsfiddle

image

Expected behavior

The escaped double quotation \" shouldn't be treated as a normal double quotation.

Guida contributor