|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /lib64/python2.7/site-packages/markupsafe/ |
Upload File : |
�
./�_c @ sE d Z d d l m Z d d l m Z d � Z d � Z d � Z d S( s�
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation used when the C module is not compiled.
:copyright: 2010 Pallets
:license: BSD-3-Clause
i ( t Markup( t text_typec C sk t | d � r t | j � � St t | � j d d � j d d � j d d � j d d � j d
d � � S( s� Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
the string with HTML-safe sequences. Use this if you need to display
text that might contain such characters in HTML.
If the object has an ``__html__`` method, it is called and the
return value is assumed to already be safe for HTML.
:param s: An object to be converted to a string and escaped.
:return: A :class:`Markup` string with the escaped text.
t __html__t &s &t >s >t <s <t 's 't "s "( t hasattrR R R t replace( t s( ( s8 /tmp/pip-install-sTXtzD/MarkupSafe/markupsafe/_native.pyt escape s c C s | d k r t � St | � S( s Like :func:`escape` but treats ``None`` as the empty string.
Useful with optional values, as otherwise you get the string
``'None'`` when the value is ``None``.
>>> escape(None)
Markup('None')
>>> escape_silent(None)
Markup('')
N( t NoneR R ( R
( ( s8 /tmp/pip-install-sTXtzD/MarkupSafe/markupsafe/_native.pyt
escape_silent&