diff options
| author | ianb <devnull@localhost> | 2007-03-06 00:43:11 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2007-03-06 00:43:11 +0000 |
| commit | a2bd62dd31636b4842e25458e1cbbea3a3052467 (patch) | |
| tree | 4db7a8269bc491340f726f1caab80796bdcc5514 /tests | |
| parent | c790b9b88439326dab89df5465a53a5169721c67 (diff) | |
| download | paste-a2bd62dd31636b4842e25458e1cbbea3a3052467.tar.gz | |
Make paste.util.template trim whitespace around statements on their own line
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_template.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_template.txt b/tests/test_template.txt index 9765011..a56049f 100644 --- a/tests/test_template.txt +++ b/tests/test_template.txt @@ -106,4 +106,13 @@ in Python, but it's more useful in templates generally):: 3 Banana O: 4 orange -
\ No newline at end of file + +It will also strip out empty lines, when there is a line that only +contains a directive/statement (if/for, etc):: + + >>> sub('{{if 1}}\n{{x}}\n{{endif}}\n', x=0) + '0\n' + >>> sub('{{if 1}}x={{x}}\n{{endif}}\n', x=1) + 'x=1\n' + >>> sub('{{if 1}}\nx={{x}}\n{{endif}}\n', x=1) + 'x=1\n' |
