Opened 10 years ago

Closed 10 years ago

#23142 closed New feature (wontfix)

Allow nested comment tags

Reported by: bcurtu Owned by: nobody
Component: Template system Version: dev
Severity: Normal Keywords: template tags
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

It may be usefull to be able to nest {% comment %} tags

Change History (4)

comment:1 by Tim Graham, 10 years ago

I don't see why it'd be useful. Can you give an example?

comment:2 by wraus, 10 years ago

I've never tried to nest comment tags, so I'm not sure what would happen, but I would assume the most common use case is to comment out a block of code that already contains a commented out block of code, for the purpose of debugging. I know that I've done that a number of times when I am working on my Python code, and can see how it would be a pain to work with for quick "let's see what happens when i comment this out" tests.

comment:3 by Tim Graham, 10 years ago

There are other ways to accomplish that like deleting the code in question and adding it back using the undo function of your editor. I am not sure how difficult supporting nested comments would be, but am in favor of simpler code and believe we have bigger problems to solve. Therefore I'm in favor of "won't fix".

comment:4 by Baptiste Mispelon, 10 years ago

Resolution: wontfix
Status: newclosed

For another point of reference, the {% verbatim %} tag doesn't allow for nested instances either.

And from what I understand, jinja2 doesn't support them either.

I agree with Tim's arguments and I'm marking this ticket as wontfix consequently. If you want to continue the discussion, try starting a thread on the django-developers mailing list.

Thanks.

Note: See TracTickets for help on using tickets.
Back to Top