Skip to content
This repository
Browse code

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

  • Loading branch information...
commit d01d34b1a127432f4e42fce7cd7bbb3f17cf10ad 2 parents ee352ec + e37f697
Armin Ronacher authored May 24, 2011
2  docs/faq.rst
Source Rendered
@@ -10,7 +10,7 @@ Why is it called Jinja?
10 10
 
11 11
 The name Jinja was chosen because it's the name of a Japanese temple and
12 12
 temple and template share a similar pronunciation.  It is not named after
13  
-the capital city of Uganda.
  13
+the city in Uganda.
14 14
 
15 15
 How fast is it?
16 16
 ---------------
7  docs/templates.rst
Source Rendered
@@ -883,8 +883,9 @@ Here two examples::
883 883
             {% include "render_box.html" %}
884 884
         {% endfor %}
885 885
 
886  
-    The included template ``render_box.html`` is not able to access
887  
-    `box` in Jinja 2.0, but in Jinja 2.1.
  886
+    The included template ``render_box.html`` is *not* able to access
  887
+    `box` in Jinja 2.0. As of Jinja 2.1 ``render_box.html`` *is* able
  888
+    to do so.
888 889
 
889 890
 
890 891
 .. _expressions:
@@ -971,7 +972,7 @@ but exists for completeness' sake.  The following operators are supported:
971 972
 
972 973
 //
973 974
     Divide two numbers and return the truncated integer result.
974  
-    ``{{ 20 / 7 }}`` is ``2``.
  975
+    ``{{ 20 // 7 }}`` is ``2``.
975 976
 
976 977
 %
977 978
     Calculate the remainder of an integer division.  ``{{ 11 % 7 }}`` is ``4``.
6  jinja2/filters.py
@@ -443,8 +443,8 @@ def do_truncate(s, length=255, killwords=False, end='...'):
443 443
     result.append(end)
444 444
     return u' '.join(result)
445 445
 
446  
-
447  
-def do_wordwrap(s, width=79, break_long_words=True):
  446
+@environmentfilter
  447
+def do_wordwrap(environment, s, width=79, break_long_words=True):
448 448
     """
449 449
     Return a copy of the string passed to the filter wrapped after
450 450
     ``79`` characters.  You can override this default using the first
@@ -452,7 +452,7 @@ def do_wordwrap(s, width=79, break_long_words=True):
452 452
     split words apart if they are longer than `width`.
453 453
     """
454 454
     import textwrap
455  
-    return u'\n'.join(textwrap.wrap(s, width=width, expand_tabs=False,
  455
+    return environment.newline_sequence.join(textwrap.wrap(s, width=width, expand_tabs=False,
456 456
                                    replace_whitespace=False,
457 457
                                    break_long_words=break_long_words))
458 458
 
2  jinja2/runtime.py
@@ -75,8 +75,6 @@ def __init__(self, context):
75 75
 
76 76
     def __getitem__(self, name):
77 77
         blocks = self.__context.blocks[name]
78  
-        wrap = self.__context.eval_ctx.autoescape and \
79  
-               Markup or (lambda x: x)
80 78
         return BlockReference(name, self.__context, blocks, 0)
81 79
 
82 80
     def __repr__(self):

0 notes on commit d01d34b

Please sign in to comment.
Something went wrong with that request. Please try again.