aboutsummaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2010-08-13 00:54:23 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2010-08-13 00:54:23 +0200
commit3051422b114d4292fef31c1e2660498c5b7d2353 (patch)
tree77b3c2691252c0f8ca583cc4666d7844c6506fce /README.rst
parent4fa38b6fb0923789b2a9e6c7f980687c1725384d (diff)
downloadmarkupsafe-3051422b114d4292fef31c1e2660498c5b7d2353.tar.gz
MarkupSafe now provides a escape_silent method as well.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index e6e9823..2f9bdac 100644
--- a/README.rst
+++ b/README.rst
@@ -31,3 +31,18 @@ the `__html__` function:
Markup(u'<strong>Nice</strong>')
>>> Markup(Foo())
Markup(u'<strong>Nice</strong>')
+
+Since MarkupSafe 0.10 there is now also a separate escape function
+called `escape_silent` that returns an empty string for `None` for
+consistency with other systems that return empty strings for `None`
+when escaping (for instance Pylons' webhelpers).
+
+If you also want to use this for the escape method of the Markup
+object, you can create your own subclass that does that::
+
+ from markupsafe import Markup, escape_silent as escape
+
+ class SilentMarkup(Markup):
+ @classmethod
+ def escape(cls, s):
+ return cls(escape(s))