autoescape no longer is a plain boolean value but can also be a function
to enable or disable autoescaping for certain filenames (or file
extensions for that matter)

--HG--
branch : trunk
diff --git a/jinja2/nodes.py b/jinja2/nodes.py
index 15461e8..b6696c7 100644
--- a/jinja2/nodes.py
+++ b/jinja2/nodes.py
@@ -72,8 +72,11 @@
     to it in extensions.
     """
 
-    def __init__(self, environment):
-        self.autoescape = environment.autoescape
+    def __init__(self, environment, template_name=None):
+        if callable(environment.autoescape):
+            self.autoescape = environment.autoescape(template_name)
+        else:
+            self.autoescape = environment.autoescape
         self.volatile = False
 
     def save(self):