Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting in Rust failure: println!("a\"b"); #1075

Closed
d33tah opened this issue Jan 24, 2019 · 1 comment · Fixed by #1120
Closed

Syntax highlighting in Rust failure: println!("a\"b"); #1075

d33tah opened this issue Jan 24, 2019 · 1 comment · Fixed by #1120

Comments

@d33tah
Copy link

d33tah commented Jan 24, 2019

In all views that use syntax highlihting, a Rust expression println!("a"b"); breaks the hightlighting, considering " as the end of a string. See the following code:

fn main() {
    println!("a\"b");
}

Related: http://rouge.jneen.net/pastes/5gRR

pyrmont added a commit to pyrmont/rouge that referenced this issue May 19, 2019
As discussed in rouge-ruby#1075, escaped double quotes were not being interpreted
correctly. This was due to an escaped double quote not being included in
the escape sequence regex in the Rust lexer.

This commit adds the double quote and the numeral zero (the null
character). See:
https://static.rust-lang.org/doc/master/reference.html#characters-and-strings

This fixes rouge-ruby#1075.
@pyrmont
Copy link
Contributor

pyrmont commented May 19, 2019

I've submitted a fix. The problem appears to have been caused by the double quote not being in the list of escape characters for some reason.

pyrmont added a commit that referenced this issue May 27, 2019
As discussed in #1075, escaped double quotes were not being interpreted
correctly. This was due to an escaped double quote not being included in
the escape sequence regex in the Rust lexer.

This commit adds the double quote and the numeral zero (the null
character). See:
https://static.rust-lang.org/doc/master/reference.html#characters-and-strings

This fixes #1075.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants