Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:mitsuhiko/jinja2

  • Loading branch information...
commit d01d34b1a127432f4e42fce7cd7bbb3f17cf10ad 2 parents ee352ec + e37f697
@mitsuhiko authored
View
2  docs/faq.rst
@@ -10,7 +10,7 @@ Why is it called Jinja?
The name Jinja was chosen because it's the name of a Japanese temple and
temple and template share a similar pronunciation. It is not named after
-the capital city of Uganda.
+the city in Uganda.
How fast is it?
---------------
View
7 docs/templates.rst
@@ -883,8 +883,9 @@ Here two examples::
{% include "render_box.html" %}
{% endfor %}
- The included template ``render_box.html`` is not able to access
- `box` in Jinja 2.0, but in Jinja 2.1.
+ The included template ``render_box.html`` is *not* able to access
+ `box` in Jinja 2.0. As of Jinja 2.1 ``render_box.html`` *is* able
+ to do so.
.. _expressions:
@@ -971,7 +972,7 @@ but exists for completeness' sake. The following operators are supported:
//
Divide two numbers and return the truncated integer result.
- ``{{ 20 / 7 }}`` is ``2``.
+ ``{{ 20 // 7 }}`` is ``2``.
%
Calculate the remainder of an integer division. ``{{ 11 % 7 }}`` is ``4``.
View
6 jinja2/filters.py
@@ -443,8 +443,8 @@ def do_truncate(s, length=255, killwords=False, end='...'):
result.append(end)
return u' '.join(result)
-
-def do_wordwrap(s, width=79, break_long_words=True):
+@environmentfilter
+def do_wordwrap(environment, s, width=79, break_long_words=True):
"""
Return a copy of the string passed to the filter wrapped after
``79`` characters. You can override this default using the first
@@ -452,7 +452,7 @@ def do_wordwrap(s, width=79, break_long_words=True):
split words apart if they are longer than `width`.
"""
import textwrap
- return u'\n'.join(textwrap.wrap(s, width=width, expand_tabs=False,
+ return environment.newline_sequence.join(textwrap.wrap(s, width=width, expand_tabs=False,
replace_whitespace=False,
break_long_words=break_long_words))
View
2  jinja2/runtime.py
@@ -75,8 +75,6 @@ def __init__(self, context):
def __getitem__(self, name):
blocks = self.__context.blocks[name]
- wrap = self.__context.eval_ctx.autoescape and \
- Markup or (lambda x: x)
return BlockReference(name, self.__context, blocks, 0)
def __repr__(self):
Please sign in to comment.
Something went wrong with that request. Please try again.