Ticket #3714: text-wrap-with-tests.patch
File text-wrap-with-tests.patch, 1.3 KB (added by , 18 years ago) |
---|
-
django/utils/text.py
17 17 pos = len(word) - word.rfind('\n') - 1 18 18 for word in it: 19 19 if "\n" in word: 20 lines = word.split lines()20 lines = word.split('\n') 21 21 else: 22 22 lines = (word,) 23 23 pos += len(lines[0]) + 1 -
tests/regressiontests/defaultfilters/tests.py
133 133 >>> wordwrap('this is a long paragraph of text that really needs to be wrapped I\'m afraid', 14) 134 134 "this is a long\nparagraph of\ntext that\nreally needs\nto be wrapped\nI'm afraid" 135 135 136 >>> wordwrap('this is a short paragraph of text.\n But this line should be indented',14) 137 'this is a\nshort\nparagraph of\ntext.\n But this\nline should be\nindented' 138 139 >>> wordwrap('this is a short paragraph of text.\n But this line should be indented',15) 140 'this is a short\nparagraph of\ntext.\n But this line\nshould be\nindented' 141 136 142 >>> ljust('test', 10) 137 143 'test ' 138 144