aboutsummaryrefslogtreecommitdiff
path: root/docs/api.rst
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2017-01-07 14:57:44 +0100
committerArmin Ronacher <armin.ronacher@active-4.com>2017-01-07 14:57:44 +0100
commit028f058370265f86ce36fc1313520c81e63fb9f0 (patch)
treec2fd3ebac437fea7877617011b95b8ef797fa732 /docs/api.rst
parentfa80a0df1f20bd5ddcfc1c414c56d8429e573476 (diff)
downloadjinja-028f058370265f86ce36fc1313520c81e63fb9f0.tar.gz
Add a policy for the ascii literal behavior. Fixes #392
Diffstat (limited to 'docs/api.rst')
-rw-r--r--docs/api.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/api.rst b/docs/api.rst
index 8bf0fdfe..3b5bccde 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -556,6 +556,16 @@ Example::
env.policies['urlize.rel'] = 'nofollow noopener'
+``compiler.ascii_str``:
+ This boolean controls on Python 2 if Jinja2 should store ASCII only
+ literals as bytestring instead of unicode strings. This used to be
+ always enabled for Jinja versions below 2.9 and now can be changed.
+ Traditionally it was done this way since some APIs in Python 2 failed
+ badly for unicode strings (for instance the datetime strftime API).
+ Now however sometimes the inverse is true (for instance str.format).
+ If this is set to False then all strings are stored as unicode
+ internally.
+
``urlize.rel``:
A string that defines the items for the `rel` attribute of generated
links with the `urlize` filter. These items are always added. The