summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJames Bennett <ubernostrum@gmail.com>2008-03-18 18:41:52 +0000
committerJames Bennett <ubernostrum@gmail.com>2008-03-18 18:41:52 +0000
commitdf225aee18176e9997d102185bc490a52b31e2fc (patch)
tree6432b9b0540570056e6c928676fc46c9bf41279e /docs
parent75617ef69f7b0fa491ce1d3cb5d4a8d478203ad1 (diff)
Fixed #6166: Improved example of autoescaping with template inheritance. Based on a patch from PJCrosier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/templates.txt8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/templates.txt b/docs/templates.txt
index 3360b04178..ea9f3fb6b2 100644
--- a/docs/templates.txt
+++ b/docs/templates.txt
@@ -429,8 +429,9 @@ all block tags. For example::
# base.html
{% autoescape off %}
- <h1>{% block title %}</h1>
+ <h1>{% block title %}{% endblock %}</h1>
{% block content %}
+ {% endblock %}
{% endautoescape %}
@@ -438,10 +439,11 @@ all block tags. For example::
{% extends "base.html" %}
{% block title %}This & that{% endblock %}
- {% block content %}<b>Hello!</b>{% endblock %}
+ {% block content %}{{ greeting }}{% endblock %}
Because auto-escaping is turned off in the base template, it will also be
-turned off in the child template, resulting in the following rendered HTML::
+turned off in the child template, resulting in the following rendered
+HTML when the ``greeting`` variable contains the string ``<b>Hello!</b>``::
<h1>This & that</h1>
<b>Hello!</b>