-
Hello!
I've been trying out your highlight.js and it seems to work great, unless it's highlighting a python file beginning with a mult-line doc string. For example, the following snippet will highlight correctly:
but this file won't highlight:<pre><code class="python">
"""A module for highlighting."""
__author__ = "Gabe"
class Dummy:
pass
</code></pre>
Do you have any advice for how to fix this? Thanks!<pre><code class="python">
"""A module for highlighting.
It's very useful.
"""
class Dummy:
pass
</code></pre>
gabe -
Hi!
I can't reproduce the bug myself with the latest version (4.2.1). It works right here, on the forum:
"""A module for highlighting. It's very useful. """ class Dummy: passCan you make an example page somewhere so I could look at it?
-
Oof, I think I misdiagnosed the problem, and it was entirely my fault. I'm serving the text being highlighted out of a database. I think I had stripped the newlines for some files, but not for others. Could that have been the problem? I tried uploading a new file to the database (that contains a multi-line docstring at the beginning) and it worked fine.
My apologies for the confusion.
gabe -
It's hard to tell without looking at the exact output that didn't work. From the top of my head I can't think of a reason why newlines might be a problem here... Anyway, I'm glad that the problem's gone. Feel free to ask if it appears again!
