1. Gabe

    14.09.2008 09:50

    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:
    <pre><code class="python">
    """A module for highlighting."""

    __author__ = "Gabe"

    class Dummy:
    pass
    </code></pre>
    but this file won't highlight:
    <pre><code class="python">
    """A module for highlighting.

    It's very useful.
    """

    class Dummy:
    pass
    </code></pre>
    Do you have any advice for how to fix this? Thanks!
    gabe
  2. Иван Сагалаев

    14.09.2008 14:46

    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:
      pass
    

    Can you make an example page somewhere so I could look at it?

  3. Gabe

    14.09.2008 20:50

    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
  4. Иван Сагалаев

    14.09.2008 21:34

    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!

bbcode