Skip to content

Commit

Permalink
the two escape implementations work the same now, updated jinja2-debu…
Browse files Browse the repository at this point in the history
…g to load the i18n extension

--HG--
branch : trunk
  • Loading branch information
mitsuhiko committed May 14, 2008
1 parent 08a6a3b commit 9d42abf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jinja2-debug.py
Expand Up @@ -13,7 +13,7 @@
import jinja2
from werkzeug import script

env = jinja2.Environment()
env = jinja2.Environment(extensions=['jinja2.ext.i18n'])

def shell_init_func():
def _compile(x):
Expand Down
2 changes: 1 addition & 1 deletion jinja2/compiler.py
Expand Up @@ -712,7 +712,7 @@ def visit_Extends(self, node, frame):
raise CompilerExit()
self.outdent()

self.writeline('parent_template = environment.get_template(', node, 1)
self.writeline('parent_template = environment.get_template(', node)
self.visit(node.template, frame)
self.write(', %r)' % self.name)
self.writeline('for name, parent_block in parent_template.'
Expand Down
9 changes: 4 additions & 5 deletions jinja2/ext.py
Expand Up @@ -35,11 +35,10 @@ def __new__(cls, name, bases, d):

class Extension(object):
"""Extensions can be used to add extra functionality to the Jinja template
system at the parser level. This is a supported but currently
undocumented interface. Custom extensions are bound to an environment but
may not store environment specific data on `self`. The reason for this is
that an extension can be bound to another environment (for overlays) by
creating a copy and reassigning the `environment` attribute.
system at the parser level. Custom extensions are bound to an environment
but may not store environment specific data on `self`. The reason for
this is that an extension can be bound to another environment (for
overlays) by creating a copy and reassigning the `environment` attribute.
As extensions are created by the environment they cannot accept any
arguments for configuration. One may want to work around that by using
Expand Down
2 changes: 1 addition & 1 deletion jinja2/utils.py
Expand Up @@ -497,7 +497,7 @@ def escape(s):
.replace('>', '>')
.replace('<', '&lt;')
.replace("'", '&#39;')
.replace('"', '&quot;')
.replace('"', '&#34;')
)

def soft_unicode(s):
Expand Down

0 comments on commit 9d42abf

Please sign in to comment.