#33243: Inline comment vanishes in parsed template, comment block is
represented as
CommentNode
-------------------------------------------+------------------------
Reporter: D. W. | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
When parsing a template via
{{{#!python
from django.template import Template
template1 = Template('{# inline comment #}')
template2 = Template('{% comment %}block comment{% endblock %}')
}}}
the nodelist of the inline comment '''{# ... #}''' will be empty, but the
nodelist of the block comment '''{% comment %}...{% endcomment %}''' will
show the CommentNode.
{{{#!python
print(template1.nodelist)
# -> []
print(template2.nodelist)
# -> [<django.template.defaulttags.CommentNode object at 0x...>]
}}}
The inline comment should also be visible in the nodelist ... as a
CommentNode oder an InlineCommentNode.
--
Ticket URL: <https://code.djangoproject.com/ticket/33243>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.9edbbaf6ce7abd3dce4001257c02173f%40djangoproject.com.