NOXSHELL
Server: Apache
System: Linux p3plzcpnl504199.prod.phx3.secureserver.net 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User: zew5vtsbg2ra (9542639)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib64/python3.12/html/__pycache__/parser.cpython-312.opt-1.pyc
�

T��h�N���dZddlZddlZddlmZdgZejd�Zejd�Zejd�Z	ejd�Z
ejd	�Zejd
�Zejd�Z
ejd�Zejd
�Zejd�Zejdej"�Zejdej"�Zejdej"�Zejd�Zejd�ZGd�dej.�Zy)zA parser for HTML and XHTML.�N)�unescape�
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]z
</[a-zA-Z]�>z--!?>z-?>z0([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*a{
  (
    (?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
   )
  ([\t\n\r\f ]*=[\t\n\r\f ]*        # value indicator
    ('[^']*'                        # LITA-enclosed value
    |"[^"]*"                        # LIT-enclosed value
    |(?!['"])[^>\t\n\r\f ]*         # bare value
    )
   )?
  (?:[\t\n\r\f ]|/(?!>))*           # possibly followed by a space
a
  [a-zA-Z][^\t\n\r\f />]*           # tag name
  [\t\n\r\f /]*                     # optional whitespace before attribute name
  (?:(?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]*  # attribute name
    (?:[\t\n\r\f ]*=[\t\n\r\f ]*    # value indicator
      (?:'[^']*'                    # LITA-enclosed value
        |"[^"]*"                    # LIT-enclosed value
        |(?!['"])[^>\t\n\r\f ]*     # bare value
       )
     )?
    [\t\n\r\f /]*                   # possibly followed by a space
   )*
   >?
aF
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c����eZdZdZdZdZdd��fd�
Z�fd�Zd�Zd	�Z	d
Z
d�Zdd
�d�Zd�Z
d#d�Zd�Zd�Zd#d�Zd$d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Zd"�Z �xZ!S)%raEFind tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    )�script�style)�textarea�titleT)�convert_charrefsc�P��t�|��||_|j�y)z�Initialize and reset this instance.

        If convert_charrefs is True (the default), all character references
        are automatically converted to the corresponding Unicode characters.
        N)�super�__init__r�reset)�selfr�	__class__s  ��$/usr/lib64/python3.12/html/parser.pyrzHTMLParser.__init__ss!���	���� 0����
�
��c�~��d|_d|_t|_d|_d|_d|_t�|�!�y)z1Reset this instance.  Loses all unprocessed data.�z???NT)	�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_support_cdata�
_escapabler
r)rrs �rrzHTMLParser.reset}s8���������-������"������
��
�rc�N�|j|z|_|jd�y)z�Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        rN)r�goahead�r�datas  r�feedzHTMLParser.feed�s���|�|�d�*������Q�rc�&�|jd�y)zHandle any buffered data.�N)r�rs r�closezHTMLParser.close�s
�����Q�rNc��|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textr$s r�get_starttag_textzHTMLParser.get_starttag_text�s���#�#�#rF��	escapablec�v�|j�|_||_|rT|jsHt	j
d|jztjtjz�|_yt	j
d|jztjtjz�|_y)Nz&|</%s(?=[\t\n\r\f />])z</%s(?=[\t\n\r\f />]))	�lowerrrr�re�compile�
IGNORECASE�ASCIIr)r�elemr*s   r�set_cdata_modezHTMLParser.set_cdata_mode�s���*�*�,���#����T�2�2�!�z�z�*D�t���*V�*,�-�-����*@� B�D�� "�z�z�*B�T�_�_�*T�*,�-�-����*@� B�D�rc�6�t|_d|_d|_y)NT)rrrrr$s r�clear_cdata_modezHTMLParser.clear_cdata_mode�s��-��������rc��||_y)aEnable or disable support of the CDATA sections.
        If enabled, "<[CDATA[" starts a CDATA section which ends with "]]>".
        If disabled, "<[CDATA[" starts a bogus comments which ends with ">".

        This method is not called by default. Its purpose is to be called
        in custom handle_starttag() and handle_endtag() methods, with
        value that depends on the adjusted current node.
        See https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
        for details.
        N)r)r�flags  r�_set_support_cdatazHTMLParser._set_support_cdata�s��#��rc��|j}d}t|�}||k�r2|jrq|jse|j	d|�}|dkr�|jdt
||dz
��}|dk\r'tjd�j||�s�n�|}n?|jj||�}|r|j�}n|jr�nx|}||krJ|jr*|jr|jt|||��n|j|||�|j||�}||k(r�n|j }|d|��r=t"j%||�r|j'|�}	n�|d|�r|j)|�}	nt|d|�r|j+|�}	nY|d|�r|j-|�}	n>|d	|�r|j/|�}	n#|d
z|ks|r|jd�|d
z}	n�nA|	dk�rl|s�n7t"j%||�r�nN|d|�rK|dz|k(r|jd��n*t0j%||�r�n|j3||dzd�n�|d|�rF|}dD]'}
|j5|
|d
z�s�|t|
�z}n|j3||d
z|�n�|d|�r$|j6r|j9||dzd�n~|||dzj;�dk(r|j=||dzd�nM|d	|�r|j3||dzd�n,|d|�r|j?||dzd�ntAd��|}	|j||	�}�n�|d|�r�tBj%||�}|rY|jE�dd}|jG|�|jI�}	|d|	d
z
�s|	d
z
}	|j||	�}���d||dvr,|j|||dz�|j||dz�}�n|d|�r�tJj%||�}|rW|jEd
�}|jM|�|jI�}	|d|	d
z
�s|	d
z
}	|j||	�}���tNj%||�}|rE|rB|jE�||dk(r,|jI�}	|	|kr|}	|j||d
z�}n7|d
z|kr'|jd�|j||d
z�}nn||kr��2|ra||kr\|jr*|jr|jt|||��n|j|||�|j||�}||d|_y)Nr�<�&�"z[\t\n\r\f ;]z</�<!--z<?z<!r#�)z--!z--�-��	<![CDATA[��	�	<!doctypezwe should not get here!z&#����;)(r�lenrr�find�rfind�maxr-r.�searchr�startr�handle_datar�	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�
endtagopen�handle_comment�endswithr�unknown_declr,�handle_decl�	handle_pi�AssertionError�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)rr`r�i�n�j�ampposrPrN�k�suffix�names            rrzHTMLParser.goahead�s{���,�,��
����L���!�e��$�$�T�_�_��L�L��a�(���q�5�%�]�]�3��A�q��t��=�F��!���J�J��7�>�>�w��O���A��(�(�/�/���;������
�A������A��1�u��(�(�T�_�_��$�$�X�g�a��l�%;�<��$�$�W�Q�q�\�2����q�!�$�A��A�v�u� �+�+�J��#�q�!��%�%�g�q�1��+�+�A�.�A���a�(��)�)�!�,�A����*��*�*�1�-�A���a�(��
�
�a�(�A���a�(��3�3�A�6�A��!�e�q�[�C��$�$�S�)��A��A���q�5���#�)�)�'�1�5��#�D�!�,��q�5�A�:� �,�,�T�2�'�-�-�g�q�9� �!�/�/���!���
�>�#�F�A�.���&8�F�&�/�/���!��<� !�S��[� 0�� %�'9��+�+�G�A�a�C��N�;�#�K��3��8K�8K��)�)�'�!�A�#�$�-�8� ��1�Q�3��-�-�/�;�>��(�(���1����7�#�D�!�,��+�+�G�A�a�C�D�M�:�#�D�!�,����w�q��s�t�}�5�,�-F�G�G��A��N�N�1�a�(���D�!�$��
�
�g�q�1��� �;�;�=��2�.�D��'�'��-��	�	��A�%�c�1�Q�3�/���E�����q�!�,�A���g�a�b�k�)��(�(���1�Q�3��8� �N�N�1�a��c�2����C��#�!�����3��� �;�;�q�>�D��)�)�$�/��	�	��A�%�c�1�Q�3�/���E�����q�!�,�A��"�(�(��!�4����u�{�{�}�����;�!�I�I�K����6� !�A� �N�N�1�a�!�e�4����!�e�q�[��$�$�S�)����q�!�a�%�0�A��s�!�e�z�1�q�5��$�$����� � ��'�!�A�,�!7�8�� � ���1��.����q�!�$�A��q�r�{��rc��|j}|||dzdk(r|j|�S|||dzdk(rC|jr7|jd|dz�}|dkry|j	||dz|�|dzS|||dzj�d	k(r7|jd
|dz�}|dk(ry|j
||dz|�|dzS|||dzd
k(ra|jd
|dz�}|dkry||dz
dk(r|j	||dz|dz
�|dzS|j||dz|�|dzS|j|�S)Nr?r<rBr@z]]>rrDrArCrr=r#z<![�])	rrSrrGrYr,rZrW�parse_bogus_comment)rrdrrf�gtposs     rrUz!HTMLParser.parse_html_declarationEs����,�,���1�Q�q�S�>�V�#��%�%�a�(�(�
�Q�q��s�^�{�
*�t�/B�/B����U�A�a�C�(�A��1�u�����g�a��c�1�o�.��q�5�L�
�Q�q��s�^�
!�
!�
#�{�
2��L�L��a��c�*�E���{�����W�Q�q�S��/�0���7�N�
�Q�q��s�^�u�
$����S�!�A�#�&�A��1�u���q��s�|�s�"��!�!�'�!�A�#�q��s�"3�4��q�5�L��#�#�G�A�a�C��O�4��q�5�L��+�+�A�.�.rc��|j}tj||dz�}|stj	||dz�}|sy|r'|j�}|j
||dz|�|j�S)Nr?rD)r�commentcloserJ�commentabruptcloserPrKrWr`)rrd�reportrrPrfs      rrSzHTMLParser.parse_commentgsr���,�,���#�#�G�Q�q�S�1���&�,�,�W�a��c�:�E�������
�A������!��Q��0��y�y�{�rc��|j}|jd|dz�}|dk(ry|r|j||dz|�|dzS)Nrr=rDr#)rrGrW)rrdrrr�poss     rrmzHTMLParser.parse_bogus_commentvsP���,�,���l�l�3��!��$���"�9��������!��C� 0�1��Q�w�rc���|j}tj||dz�}|sy|j�}|j	||dz|�|j�}|S)Nr=rD)r�picloserJrKr[r`�rrdrrPrfs     rrTzHTMLParser.parse_pi�sV���,�,�����w��!��,�����K�K�M�����w�q��s�A��'��I�I�K���rc��d|_|j|�}|dkr|S|j}||||_g}tj	||dz�}|j�}|j
d�j�x|_}||kr�tj	||�}|sn�|j
ddd�\}	}
}|
sd}n,|dddcxk(r|ddk(sn|dddcxk(r|ddk(rnn|dd}|rt|�}|j|	j�|f�|j�}||kr��|||j�}|dvr|j|||�|S|jd	�r|j||�|S|j!||�||j"vr|j%|�|S||j&vr|j%|d
��|S)Nrr#r=rA�'rD�")r�/>r{Tr))r'�check_for_whole_start_tagr�tagfind_tolerantrPr`r^r,r�attrfind_tolerantr�append�striprLrX�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr2�RCDATA_CONTENT_ELEMENTS)
rrd�endposr�attrsrPrh�tag�m�attrname�rest�	attrvaluer`s
             rrQzHTMLParser.parse_starttag�s��� $����/�/��2���A�:��M��,�,��&�q��0����� �&�&�w��!��4���I�I�K��"�[�[��^�1�1�3�3���s��&�j�!�'�'���3�A���()����1�a�(8�%�H�d�I�� �	��2�A��$�8�)�B�C�.�8��2�A��#�7��2�3��7�%�a��O�	��$�Y�/�	��L�L�(�.�.�*�I�6�7�����A��&�j��a���%�%�'���k�!����W�Q�v�.�/��M��<�<����#�#�C��/��
�
� � ��e�,��d�1�1�1��#�#�C�(��
���4�4�4��#�#�C�4�#�8��
rc��|j}tj||dz�}|j�}||dz
dk7ry|S)Nr#rrD)r�locatetagendrPr`rws     rr|z$HTMLParser.check_for_whole_start_tag�sD���,�,���"�"�7�A�a�C�0���I�I�K���1�Q�3�<�3����rc���|j}|jd|dz�dkrytj||�s$||dz|dzdk(r|dzS|j	|�St
j||dz�}|j
�}||dz
dk7rytj||dz�}|jd�j�}|j|�|j�|S)Nrr=rrDrAr#)rrGrVrPrmr�r`r}r^r,�
handle_endtagr4)rrdrrPrfr�s      rrRzHTMLParser.parse_endtag�s����,�,���<�<��Q�q�S�!�A�%�������+��q��s�1�Q�3��3�&���s�
��/�/��2�2��"�"�7�A�a�C�0���I�I�K���1�Q�3�<�3���!�&�&�w��!��4���k�k�!�n�"�"�$�����3�������rc�J�|j||�|j|�y�N)r�r��rr�r�s   rr�zHTMLParser.handle_startendtag�s �����S�%�(����3�rc��yr��r�s   rr�zHTMLParser.handle_starttag����rc��yr�r�)rr�s  rr�zHTMLParser.handle_endtag�r�rc��yr�r��rrjs  rr_zHTMLParser.handle_charref�r�rc��yr�r�r�s  rrbzHTMLParser.handle_entityref�r�rc��yr�r�rs  rrLzHTMLParser.handle_data�r�rc��yr�r�rs  rrWzHTMLParser.handle_comment�r�rc��yr�r�)r�decls  rrZzHTMLParser.handle_declr�rc��yr�r�rs  rr[zHTMLParser.handle_pir�rc��yr�r�rs  rrYzHTMLParser.unknown_decl
r�r)T)r#)"�__name__�
__module__�__qualname__�__doc__r�r�rrr!r%r'r(r2r4r7rrUrSrmrTrQr|rRr�r�r�r_rbrLrWrZr[rY�
__classcell__)rs@rrrZs�����*1��3��+/������O�$�16�B��
#� G#�X/�D�	�	�,�`��< �

�
�
�
�
�
�
�
�
r)r�r-�_markupbase�htmlr�__all__r.rrcrar]rOrVrvrprqr}�VERBOSEr~r��locatestarttagend_tolerant�	endendtag�
endtagfind�
ParserBaserr�rr�<module>r�s[��"�
����.�� �R�Z�Z��'��
�R�Z�Z��
%�
��B�J�J�>�?�	�
�"�*�*�@�
A���r�z�z�+�&��
�R�Z�Z��
%�
�
�"�*�*�S�/���r�z�z�(�#���R�Z�Z��'���2�:�:�Q�R���B�J�J� ��Z�Z����r�z�z�
��Z�Z�
�� (�R�Z�Z�)��Z�Z���
�B�J�J�s�O�	�
�R�Z�Z�>�
?�
�q
��'�'�q
r