Django

Code

Changeset 4753

Show
Ignore:
Timestamp:
03/20/07 06:07:52 (1 year ago)
Author:
russellm
Message:

Fixed #3714 -- Fixed handling of indented text in wordwrap template filter. Thanks for the fix, Ian Clelland.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/utils/text.py

    r4468 r4753  
    1818        for word in it: 
    1919            if "\n" in word: 
    20                 lines = word.splitlines(
     20                lines = word.split('\n'
    2121            else: 
    2222                lines = (word,) 
  • django/trunk/tests/regressiontests/defaultfilters/tests.py

    r4558 r4753  
    134134"this is a long\nparagraph of\ntext that\nreally needs\nto be wrapped\nI'm afraid" 
    135135 
     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 
    136142>>> ljust('test', 10) 
    137143'test      '