fixed error in wordwrap filter
authorBenjamin Wiegand <highwaychile@bluevaria.de>
Mon, 9 Jun 2008 17:09:34 +0000 (19:09 +0200)
committerBenjamin Wiegand <highwaychile@bluevaria.de>
Mon, 9 Jun 2008 17:09:34 +0000 (19:09 +0200)
--HG--
branch : trunk

jinja2/filters.py

index 762b06dd2d83ca4a04beb33cf907ba6f6087f3a7..959b4daee480eb7cd3272aabaa5b5fe321a83c7b 100644 (file)
@@ -366,9 +366,9 @@ def do_wordwrap(s, width=79, break_long_words=True):
     parameter.  If you set the second parameter to `false` Jinja will not
     split words apart if they are longer than `width`.
     """
-    return textwrap.wrap(s, width=width, expand_tabs=False,
-                         replace_whitespace=False,
-                         break_long_words=break_long_words)
+    return u'\n'.join(textwrap.wrap(s, width=width, expand_tabs=False,
+                                   replace_whitespace=False,
+                                   break_long_words=break_long_words))
 
 
 def do_wordcount(s):