Skip to content
Myr

Merge branch 'master' into sprint-branch

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents 7e58e36, 728d69a · Browse files · 2 files+13 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−3 removed

  • other:+13 added−3 removed

2 files+13 added−3 removed

modified:jinja2/filters.py+11 added-3 removed
470 unmodified lines
471 result.append(end)472 return u' '.join(result)473474@environmentfilter475def do_wordwrap(environment, s, width=79, break_long_words=True):475def do_wordwrap(environment, s, width=79, break_long_words=True,476 wrapstring=None):477 """478 Return a copy of the string passed to the filter wrapped after479 ``79`` characters. You can override this default using the first480 parameter. If you set the second parameter to `false` Jinja will not480 split words apart if they are longer than `width`.481 split words apart if they are longer than `width`. By default, the newlines482 will be the default newlines for the environment, but this can be changed483 using the wrapstring keyword argument.484485 .. versionadded:: 2.7486 Added support for the `wrapstring` parameter.487 """488 if not wrapstring:489 wrapstring = environment.newline_sequence490 import textwrap483 return environment.newline_sequence.join(textwrap.wrap(s, width=width, expand_tabs=False,491 return wrapstring.join(textwrap.wrap(s, width=width, expand_tabs=False,492 replace_whitespace=False,493 break_long_words=break_long_words))494495
344 unmodified lines
modified:CHANGES+2 added
16 unmodified lines
17 to be consumed into a list.18- Python requirement changed: 2.6, 2.7 or >= 3.3 are required now,19 supported by same source code, using the "six" compatibility library.20- Allow `contextfunction` and other decorators to be applied to `__call__`.21- Added support for changing from newline to different signs in the `wordwrap`22 filter.2324Version 2.625-----------26(codename Convolution, released on July 24th 2011)
263 unmodified lines