U
    wy]                  ~   @   s  d Z ddlZddlmZ ddgZdddZdd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*"Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddh~Z	dd Z
edZdd ZdS )z*
General functions for HTML manipulation.
    N)html5escapeunescapeTc                 C   sD   |  dd} |  dd} |  dd} |r@|  dd} |  d	d
} | S )z
    Replace special characters "&", "<" and ">" to HTML-safe sequences.
    If the optional flag quote is true (the default), the quotation mark
    characters, both double quote (") and single quote (') characters are also
    translated.
    &z&amp;<z&lt;>z&gt;"z&quot;'z&#x27;)replace)squote r   J/home/stadmin/Documents/SimTableSoftware/Python-3.8.0/Lib/html/__init__.pyr      s       �u   €   u   ‚u   ƒu   „u   …u   †u   ‡u   ˆu   ‰u   Šu   ‹u   Œ   u   Ž      u   ‘u   ’u   “u   ”u   •u   –u   —u   ˜u   ™u   šu   ›u   œ   u   žu   Ÿ)"r                                                                                                                                                                                       r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i  i     i  i  i i i i i i i i i i i i i i i i i	 i	 i
 i
 i i i i i i i i i i i  c                 C   s   |  d} | d dkr| d dkr<t| dd  dd}nt| dd  d}|tkrbt| S d|  krvd	ksn |d
krdS |tkrdS t|S | tkrt|  S tt| d ddD ]4}| d | tkrt| d |  | |d     S qd|  S d S )Nr7   r   #ZxXr8   ;rA   i   i  rS   r    r   )	groupintrstrip_invalid_charrefs_invalid_codepointschr_html5rangelen)r   numxr   r   r   _replace_charref[   s$    
"rc   z7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)c                 C   s   d| kr| S t t| S )a^  
    Convert all named and numeric character references (e.g. &gt;, &#62;,
    &x3e;) in the string s to the corresponding unicode characters.
    This function uses the rules defined by the HTML 5 standard
    for both valid and invalid character references, and the list of
    HTML 5 named character references defined in html.entities.html5.
    r   )_charrefsubrc   )r   r   r   r   r   z   s    )T)__doc__re_reZhtml.entitiesr   r^   __all__r   r[   r\   rc   compilerd   r   r   r   r   r   <module>   sR  
'                                                                                                               
