diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/utils.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 22d54d137f..a8b8fc9d7f 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -790,6 +790,17 @@ appropriate entities. Can be called multiple times on a single string. + String marked safe will become unsafe again if modified. For example:: + + >>> mystr = '<b>Hello World</b> ' + >>> mystr = mark_safe(mystr) + >>> type(mystr) + <class 'django.utils.safestring.SafeBytes'> + + >>> mystr = mystr.strip() # removing whitespace + >>> type(mystr) + <type 'str'> + .. function:: mark_for_escaping(s) Explicitly mark a string as requiring HTML escaping upon output. Has no |
