jgm / skylighting

A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions
194 stars 62 forks source link

Bad syntax highlighting: identifier error #77

Closed brevzin closed 5 years ago

brevzin commented 5 years ago

Short examples:

$ echo "\`c3way\`{.cpp}" | pandoc
<p><code class="sourceCode cpp">c<span class="dv">3</span><span class="er">way</span></code></p>

$ echo "\`v1 < v2\`{.cpp}" | pandoc
<p><code class="sourceCode cpp">v1 &lt; v<span class="dv">2</span></code></p>

It seems like there's something up with DetectIdentifier. We replaced the instance of that within "match identifier" with <RegExpr attribute="Ignore" context="#stay" String="[a-zA-Z_]\w*" /> and the above got parsed correctly.

jgm commented 5 years ago

Sounds like 9e9ea066c25d3ae6b17f9ecf0f1dfc0039d20d5d which is fixed in 0.8.1. pandoc --version will tell you which version of skylighting your pandoc is compiled against...

brevzin commented 5 years ago

0.7.7. I think I still have the latest release (2.7.2).

jgm commented 5 years ago

This is fixed now. You can recompile pandoc from source against 0.8.1, or wait for the next pandoc release.