summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2012-06-30 16:41:51 +0100
committerLuke Plant <L.Plant.98@cantab.net>2012-07-03 22:20:12 +0100
commitf33e15036907d6e4bda6116dc84097e9e590d2c8 (patch)
treeabd43daa68553d846e2d7e7832912ab72eb963c0 /docs
parentcf731a543eaae43f989f237727411763c386af1b (diff)
Documented utils.html.escape and conditional_escape
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/utils.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 0974409453..549812296b 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -387,6 +387,28 @@ Atom1Feed
input is a proper string, then add support for lazy translation objects at the
end.
+``django.utils.html``
+=====================
+
+.. module:: django.utils.html
+ :synopsis: HTML helper functions
+
+Usually you should build up HTML using Django's templates to make use of its
+autoescape mechanism, using the utilities in :mod:`django.utils.safestring`
+where appropriate. This module provides some additional low level utilitiesfor
+escaping HTML.
+
+.. function:: escape(text)
+
+ Returns the given text with ampersands, quotes and angle brackets encoded
+ for use in HTML. The input is first passed through
+ :func:`~django.utils.encoding.force_unicode` and the output has
+ :func:`~django.utils.safestring.mark_safe` applied.
+
+.. function:: conditional_escape(text)
+
+ Similar to ``escape()``, except that it doesn't operate on pre-escaped strings,
+ so it will not double escape.
``django.utils.http``
=====================