diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index e03a775..311871e 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -557,16 +557,16 @@ escaping HTML. So, instead of writing: .. code-block:: python - + mark_safe(u"%s %s %s" % (some_html, escape(some_text), escape(some_other_text), )) you should instead use: - + .. code-block:: python - + format_html(u"{0} {1} {2}", mark_safe(some_html), some_text, some_other_text) @@ -722,7 +722,7 @@ Functions for working with Python modules. ImproperlyConfigured = import_by_path('django.core.exceptions.ImproperlyConfigured') is equivalent to:: - + from django.core.exceptions import ImproperlyConfigured ``django.utils.safestring`` @@ -763,7 +763,19 @@ appropriate entities. object can be used everywhere a string or unicode object is appropriate. Can be called multiple times on a single string. - + String marked safe will become unsafe again if modified. + + For example:: + + mystr = 'Hello World ' + mystr = mark_safe(mystr) + type(mystr) + + + mystr = mystr.strip() #removing white-spaces + type(mystr) + + .. function:: mark_for_escaping(s) Explicitly mark a string as requiring HTML escaping upon output. Has no