tickets: 2594
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2594 | 2006-08-23 05:44:08 | 2015-04-15 14:38:35 | 2022-03-06 03:26:28.336944 | Accepted | closed | Template system | Bug | Normal | dev | wontfix | Template system should handle whitespace better | So, I think that the template system should not leave blank lines behind if the tag(s) on that line evaulated to the empty string. To make sure we are all on the same page, here is an example: This template code: {{{ <h1>My list</h1> <ul> {% for item in items %} <li>{{ item }}</li> {% endfor %} </ul> }}} Would normally evaluate to: {{{ <h1>My list</h1> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> }}} And with the {% spaceless %} tag evaluates to: {{{ <h1>My list</h1> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> }}} And with the StripWhitespaceMiddleware evaluates to {{{ <h1>My list</h1> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> }}} But what I think should evaluate to: {{{ <h1>My list</h1> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> }}} In other words, leave lines that I add, but remove the empty lines that had template tags on them. | jshedd | Gary Wilson <gary.wilson@gmail.com> | 0 | 1 | 1 | 0 | 0 | 0 |