#975 Django lexer does not color the {# #} comments

Bug
closed-fixed
Neil Hodgson
Scintilla (788)
3
2011-05-25
2010-06-09
Anonymous
No

Thank you for adding the lexer for Djangp {{ }} and {% %}.

But it lacks the {# #} which identify comments.
http://docs.djangoproject.com/en/1.2/topics/templates/#comments

Discussion

  • Neil Hodgson
    Neil Hodgson
    2010-06-10

    • assigned_to: nobody --> nyamatongwe
    • priority: 5 --> 3
    • status: open --> open-accepted
     
  • Neil Hodgson
    Neil Hodgson
    2010-06-10

    I'll leave this for anyone interested in Django.

     

  • Anonymous
    2010-06-10

    Notice that the same lexer can be used with Jinja2, which is very similar with Django templates (and probably better :-) )
    I don't use Django myself. only Jinja2.

    Please accept newlines between {# and #}, (they are allowed with Jinja templates).
    http://jinja.pocoo.org/2/documentation/templates#comments

     
    Last edit: Anonymous 2014-02-26
  • Includes code that implements {# #} comment highlighting

     
    Attachments
  • Just added a copy of LexHTML.cxx that includes implementation of this. Based on recent but perhaps not most recent rev of this file. Search for "handle the start/end of Django comment" to find the new code quickly w/o compare. Those two "else if" blocks are the entire change.

     
  • Neil Hodgson
    Neil Hodgson
    2011-04-05

    • status: open-accepted --> open-fixed
     
  • Neil Hodgson
    Neil Hodgson
    2011-04-05

    Committed. This doesn't appear to work well for multi-line comments like the example pointed to in the reporters' second post as the commenting style continues beyond the #}.

     
  • Odd, but I'm not seeing any problem w/ multi-line {# #} comments...

     
  • Neil Hodgson
    Neil Hodgson
    2011-04-16

    Try the following piece. The {% interrupts the comment where http://jinja.pocoo.org/docs/templates/#comments indicates that it should be disabled.

    -----------------------------
    <HTML>
    Django stuff

    {# note: disabled template because we no longer use this
    {% for user in users %}
    ...
    {% endfor %}
    #}

    <div id="sidebar">

    </HTML>
    -----------------------------

     
  • Neil Hodgson
    Neil Hodgson
    2011-05-25

    • status: open-fixed --> closed-fixed