A python lone string is highlighted as a comment
Closed this issue · 4 comments
Explain the problem.
When a lone python string is highlighted, it is tagged as comment. i.e. class="co"
For comparison, the string is also valid in r and ruby and for them the highlight class is correct i.e. class="st"
Try Pandoc with highlighting set.
`"string"`{.py}
`"string"`{.r}
`"string"`{.rb}
Output
<p><code
class="sourceCode python"><span class="co">"string"</span></code></p>
<p><code
class="sourceCode r"><span class="st">"string"</span></code></p>
<p><code
class="sourceCode ruby"><span class="st">"string"</span></code></p>
Pandoc version?
3.1.9
I'm seeing the same behavior in the Kate editor. (Of course, in x = "hello"
it's marked as a string.)
So, this may be intentional; at any rate, our skylighting library (jgm/skylighting) is correctly interpreting the KDE syntax definition.
If you like, you can investigate the python.xml syntax definition and/or submit a bug report to KDE's syntax highlighting framework.
https://github.com/KDE/syntax-highlighting/tree/master/data/syntax
I've transferred this to skylighting, which is the library that does the highlighting. But I think it should be closed, as the issue is upstream.
Ah yes, of course, I should have thought of that.