Opened 19 years ago
Closed 19 years ago
#696 closed enhancement (wontfix)
add newline-suppression to {% and {{
Reported by: | hugo | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Template system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Both {{ and {% could be closeable with -}} and -%} to suppress a newline if the ending is at the end of the line, too. This would help to make more readable templates for formats that are whitespace-sensitive - currently you would have to write all template code in one line if the output should be just one line. With newline suppression, one could break long lines and still only get one line output.
And yes, I know that it is shamelessly stolen from the ERb definition ;)
Change History (4)
comment:1 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 19 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
I agree with the sentiment about the syntax, but like hugo I find the blank lines in my (otherwise pristine) outputted HTML really annoying. It seems to me this is would be solved by stripping any whitespace up to and including the newline following any {% end %} tag (doesn't address the issue of having to do {{}} inline, but that's not as troublesome, in my experience).
The possiblity exists that this might make output too squished, but it's easy enough to add extra newlines. I don't have a way to address the present situation short of writing my own middleware, which seems excessive . . .
comment:4 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
I'm marking this as a wontfix again.
Too Perlish!