[py3] Ported django.utils.safestring.

Backwards compatibility aliases were created under Python 2.
This commit is contained in:
Aymeric Augustin 2012-08-18 16:04:06 +02:00
parent e41c308014
commit 547b181046
8 changed files with 82 additions and 54 deletions

View file

@ -560,15 +560,29 @@ string" means that the producer of the string has already turned characters
that should not be interpreted by the HTML engine (e.g. '<') into the
appropriate entities.
.. class:: SafeBytes
.. versionadded:: 1.5
A :class:`bytes` subclass that has been specifically marked as "safe"
(requires no further escaping) for HTML output purposes.
.. class:: SafeString
A string subclass that has been specifically marked as "safe" (requires no
further escaping) for HTML output purposes.
A :class:`str` subclass that has been specifically marked as "safe"
(requires no further escaping) for HTML output purposes. This is
:class:`SafeBytes` on Python 2 and :class:`SafeText` on Python 3.
.. class:: SafeText
.. versionadded:: 1.5
A :class:`str` (in Python 3) or :class:`unicode` (in Python 2) subclass
that has been specifically marked as "safe" for HTML output purposes.
.. class:: SafeUnicode
A unicode subclass that has been specifically marked as "safe" for HTML
output purposes.
Historical name of :class:`SafeText`. Only available under Python 2.
.. function:: mark_safe(s)