o ?Og@s$dZddlZddlmZddgZdPddZiddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(id)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJZhdKZ dLdMZ e dNZ dOdZ dS)Qz* General functions for HTML manipulation. N)html5escapeunescapeTcCsD|dd}|dd}|dd}|r |dd}|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&z>"z"'z')replace)sZquoter 4/opt/alt/python310/lib64/python3.10/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Ÿ>~ iiiii irrrrrrrrrrrrrrr!r"r$r&r'r(r)r*r+r,r-r.r/r0r1r2r4r5iiii iii iii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i i i i ii icCs|d}|ddkrL|ddvrt|dddd}n t|ddd}|tvr1t|Sd|kr;d ks@n|d krBd S|tvrHd St|S|tvrTt|Stt|ddd D]}|d|tvrxt|d|||dSq^d|S)Nr6r#ZxXr7;rAiirQrr) groupintrstrip_invalid_charrefs_invalid_codepointschr_html5rangelen)r Znumxr r r _replace_charref[s&    raz7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)cCsd|vr|Stt|S)a^ Convert all named and numeric character references (e.g. >, >, &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)_charrefsubra)r r r r rzs )T)__doc__reZ_reZ html.entitiesrr]__all__rrZr[racompilerbrr r r r s        !"%