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

Highlighting raw strings is broken #125

Open
ratijas opened this issue Apr 16, 2021 · 0 comments
Open

Highlighting raw strings is broken #125

ratijas opened this issue Apr 16, 2021 · 0 comments

Comments

@ratijas
Copy link

ratijas commented Apr 16, 2021

Seems like highlight-js does not handle raw escaped strings well.

Source code:

fn main() {
    let j = r#"
        {
            "s": "1234567890",
            "ptr": "owned"
        }
    "#;

Converts to:

<span class="hljs-keyword">let</span> j = r#<span class="hljs-string">&quot;
{
&quot;</span>s<span class="hljs-string">&quot;: &quot;</span><span class="hljs-number">1234567890</span><span class="hljs-string">&quot;,
&quot;</span>pt<span class="hljs-string">r&quot;: &quot;</span>owned<span class="hljs-string">&quot;
}
&quot;</span>#;

Which renders as:

image

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

No branches or pull requests

1 participant