
2ašQ£  ã               @   sN   d  Z  d d l m Z d d l m Z d d „  Z d d „  Z d d	 „  Z d
 S)zÍ
    markupsafe._native
    ~~~~~~~~~~~~~~~~~~

    Native Python implementation the C module is not compiled.

    :copyright: (c) 2010 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
é    )ÚMarkup)Ú	text_typec             C   se   t  |  d ƒ r |  j ƒ  St t |  ƒ j d d ƒ j d d ƒ j d d ƒ j d d	 ƒ j d
 d ƒ ƒ S)zÐConvert the characters &, <, >, ' and " in string s to HTML-safe
    sequences.  Use this if you need to display text that might contain
    such characters in HTML.  Marks return value as markup string.
    Ú__html__ú&z&amp;ú>z&gt;ú<z&lt;ú'z&#39;ú"z&#34;)Úhasattrr   r   r   Úreplace)Ús© r   ú4/usr/lib/python3/dist-packages/markupsafe/_native.pyÚescape   s    
r   c             C   s   |  d k r t  ƒ  St |  ƒ S)zMLike :func:`escape` but converts `None` into an empty
    markup string.
    N)r   r   )r   r   r   r   Úescape_silent   s    r   c             C   s   t  |  t ƒ s t |  ƒ }  |  S)zoMake a string unicode if it isn't already.  That way a markup
    string is not converted back to unicode.
    )Ú
isinstancer   )r   r   r   r   Úsoft_unicode(   s    r   N)Ú__doc__Z
markupsafer   Zmarkupsafe._compatr   r   r   r   r   r   r   r   Ú<module>
   s
   	