Add note about htmltext and htmlescape to the docs ... (quixote/html.py)
Neil Schemenauer <nascheme-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Wed, 08 Jan 2003 15:16:26 -0500
| Newsgroups | gmane.comp.web.quixote.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /home/cvs/quixote
In directory hewson:/tmp/cvs-serv20235
Modified Files:
html.py
Log Message:
Add note about htmltext and htmlescape to the docstring. They should be
preferred over html_quote.
Index: html.py
===================================================================
RCS file: /home/cvs/quixote/html.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- html.py 8 Jan 2003 19:43:23 -0000 1.22
+++ html.py 8 Jan 2003 20:16:24 -0000 1.23
@@ -6,12 +6,22 @@
www.w3c.org and www.xml.com should be studied, especially the sections
on character sets, entities, attribute and values.
+htmltext and htmlescape
+-----------------------
+
+This type and function are meant to be used with [html] PTL template type.
+The htmltext type designates data that does not need to be escaped and the
+htmlescape() function calls str() on the argment, escapes the resulting
+string and returns a htmltext instance. htmlescape() does nothing to
+htmltext instances.
+
html_quote
----------
Use for quoting data that will be used within attribute values or as
-element contents. Examples:
+element contents (if the [html] template type is not being used).
+Examples:
'<title>%s</title>' % html_quote(title)
'<input type="hidden" value="%s" />' % html_quote(data)