aboutsummaryrefslogtreecommitdiffstats
path: root/mako/template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-06-22 17:35:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-06-22 17:35:14 -0400
commita0354c3ef082ab4559064529678b027ead78b031 (patch)
tree5f47a56b2952a2b7334ce685ac71c7171f15330c /mako/template.py
parentc3874653cbdf58f5aaa39ef51ee4433af4d42fb8 (diff)
downloadexternal_python_mako-a0354c3ef082ab4559064529678b027ead78b031.tar.gz
external_python_mako-a0354c3ef082ab4559064529678b027ead78b031.tar.bz2
external_python_mako-a0354c3ef082ab4559064529678b027ead78b031.zip
- Now using MarkupSafe for HTML escaping,
i.e. in place of cgi.escape(). Faster C-based implementation and also escapes single quotes for additional security. Supports the __html__ attribute for the given expression as well. When using "disable_unicode" mode, a pure Python HTML escaper function is used which also quotes single quotes. Note that Pylons by default doesn't use Mako's filter - check your environment.py file.
Diffstat (limited to 'mako/template.py')
-rw-r--r--mako/template.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mako/template.py b/mako/template.py
index 2aed7a7..ce36fa1 100644
--- a/mako/template.py
+++ b/mako/template.py
@@ -363,7 +363,8 @@ def _compile_text(template, text, filename):
buffer_filters=template.buffer_filters,
imports=template.imports,
source_encoding=lexer.encoding,
- generate_magic_comment=template.disable_unicode)
+ generate_magic_comment=template.disable_unicode,
+ disable_unicode=template.disable_unicode)
cid = identifier
if not util.py3k and isinstance(cid, unicode):
@@ -389,7 +390,8 @@ def _compile_module_file(template, text, filename, outputpath):
buffer_filters=template.buffer_filters,
imports=template.imports,
source_encoding=lexer.encoding,
- generate_magic_comment=True)
+ generate_magic_comment=True,
+ disable_unicode=template.disable_unicode)
# make tempfiles in the same location as the ultimate
# location. this ensures they're on the same filesystem,