rsmenon / pygments-mathematica

Mathematica/Wolfram Language lexer and highlighter for Pygments
MIT License
59 stars 8 forks source link

Backslash at the end of string causes wrong coloring #17

Open yuriever opened 1 year ago

yuriever commented 1 year ago

Thanks for the useful highlighter!

The minimal example is

``` wl
"\"a
which will be rendered as a whole string instead of string with the rest expression,

``` html
<div class="highlight"><pre id="__code_3"><span></span><code><span class="s">"\"a</span></code></pre></div>
image

Only after inserting some character to avoid escaping we can get the expected coloring,

``` wl
"\ "a

``` html
<div class="highlight"><pre id="__code_3"><span></span><code><span class="s">"\ "</span><span class="nv">a</span>
</code></pre></div>
image

Could you fix this issue?