diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2017-01-07 14:57:44 +0100 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2017-01-07 14:57:44 +0100 |
commit | 028f058370265f86ce36fc1313520c81e63fb9f0 (patch) | |
tree | c2fd3ebac437fea7877617011b95b8ef797fa732 /docs/api.rst | |
parent | fa80a0df1f20bd5ddcfc1c414c56d8429e573476 (diff) | |
download | jinja-028f058370265f86ce36fc1313520c81e63fb9f0.tar.gz |
Add a policy for the ascii literal behavior. Fixes #392
Diffstat (limited to 'docs/api.rst')
-rw-r--r-- | docs/api.rst | 10 |
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 |