403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /tmp/calpy/weasyprint/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /tmp/calpy/weasyprint/__pycache__/html.cpython-311.pyc
�

Х=jg:���dZddlZddlmZddlmZddlmZmZm	Z	ddl	m
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZe��Zee	��d
z�d��Zee	��dz�d��Zee	��dz�d��Zeee���Zeee���Zee���ZdZejde�d���Zejde�d���Z ejde�d���Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d �Z)d!�Z*d"�Z+d#�Z,iZ-d$�Z.d%�Z/d&�Z0e/d'��d(���Z1e/d)��d*���Z2e/d+��d,���Z3e/d-��d.���Z4e/d/��d0���Z5e/d1��d2���Z6d3�Z7d4�Z8ejd5ej9��Z:d6�Z;dS)7aVSpecific handling for some HTML elements, especially replaced elements.

Replaced elements (eg. <img> elements) are rendered externally and behave as an
atomic opaque box in CSS. In general, they may or may not have intrinsic
dimensions. But the only replaced elements currently supported in WeasyPrint
are images with intrinsic dimensions.

�N)�files)�parse_color�)�CSS�
Attachment�css)�get_child_text)�CounterStyle)�boxes)�SVGImage)�LOGGER)�get_url_attributezhtml5_ua.csszutf-8zhtml5_ua_form.csszhtml5_ph.css)�string�
counter_style�rz 	

z[^z]+z^[z]*([+-]?)([0-9]+)z]*([0-9]+([.][0-9]*)?)(%)?c���t�|pd��x}r@|�d��dkrdndt|�d����zSdS)zbParse an integer from an HTML attribute value.

    Return an integer, or ``None`` on error.

    �r�-����N)�
INTEGER_RE�match�group�int�rrs  �B/tmp/claude-1015/pip-target-jmvfl800/lib/python/weasyprint/html.py�
parse_integerr(se��� � ���2�.�.�.�u�J��k�k�!�n�n��+�+����c�%�+�+�a�.�.�6I�6I�I�I�J�J�c�8�t|��}|�|dkr|ndS)znParse a non-negative integer from an HTML attribute value.

    Return an integer, or ``None`` on error.

    Nr)r)r�integers  r�parse_non_negative_integerr!3s(���F�#�#�G��)�g��l�l�7�7��Drc��t�|pd��x}r?t|�d����|�d��dkrdndfSdS)z�Parse a dimension value from an HTML attribute value.

    Return an integer and a unit string ('%' or 'px'), or ``None`` on error.

    rr��%�pxN)�DIMENSION_REr�floatrrs  r�parse_dimension_valuer(>se���"�"�6�<�R�0�0�0�u�M��U�[�[��^�^�$�$�U�[�[��^�^�s�-B�-B�c�c��L�L�M�Mrc	���|�t��}|���dvrdSt|��}|�dSt	tdt
d|j����dz��}t	tdt
d|j����dz��}t	tdt
d|j	����dz��}d|d�|d�|d��S)z�Parse a legacy color from an HTML attribute value.

    Return a color string compatible with CSS colors, or ``None`` on error.

    )�transparent�currentcolorNrr��#�02x)
�strip�
WHITESPACE�lowerr�round�max�min�red�green�blue)r�colorr5r6r7s     r�parse_legacy_colorr9Is����\�\�*�
%�
%�F�
�|�|�~�~�8�8�8�������E��}���
��A�s�1�e�i�(�(�)�)�C�/�
0�
0�C��#�a��Q���,�,�-�-��3�4�4�E���Q��A�u�z�*�*�+�+�c�1�2�2�D�-�s�-�-��-�-�4�-�-�-�-rc���|�dd���dd���dd���dd���d	d
��}d|�d�S)zcParse a URL from an HTML attribute value.

    Return a CSS-escaped string, including quotes.

    �\z\\�"z\"�
z\A�
z\D�z\C)�replacers r�parse_stringrA]sg��	�	���v�	�	�	���e�	�	�	���u�	�	�	���u�	�	�	���u�	�	�
��v�=�=�=�rc�(�dt|���d�S)zKParse a URL from an HTML attribute value.

    Return a url() string.

    zurl(�))rArs r�	parse_urlrDms��*�,�v�&�&�)�)�)�)rc�2�t|��}|�|�d�SdS)zxMap an HTML attribute value to a pixel length.

    Return a string with the value and 'px', or ``None`` on error.

    Nr%)r!)r�values  r�map_to_pixel_lengthrGvs+��
'�v�.�.�E����|�|�|���rc�>�t|��}|�|\}}|�|��SdS)z~Map an HTML attribute value to a dimension.

    Return a string with the value and the dimension, or ``None`` on error.

    N�r(�r�	dimensionrF�units    r�map_to_dimension_propertyrM�s9��&�f�-�-�I������t��������rc�N�t|��}|�|\}}|dkr|�|��SdSdS)z�Map an HTML attribute value to a dimension, ignoring zero values.

    Return a string with the value and the dimension, or ``None`` on error.

    NrrIrJs    r�'map_to_dimension_property_ignoring_zerorO�sG��&�f�-�-�I������t��A�:�:��#�T�#�#�#����:rc�r�|���������S)a4Transform (only) ASCII letters to lower case: A-Z is mapped to a-z.

    This is used for `ASCII case-insensitive
    <https://whatwg.org/C#ascii-case-insensitive>`_ matching.

    This is different from the :meth:`str.lower` method of Unicode strings
    which also affect non-ASCII characters,
    sometimes mapping them into the ASCII range:

    >>> keyword = 'Bac\N{KELVIN SIGN}ground'
    >>> assert keyword.lower() == 'background'
    >>> assert ascii_lower(keyword) != keyword.lower()
    >>> assert ascii_lower(keyword) == 'bac\N{KELVIN SIGN}ground'

    )�encoder1�decoders r�ascii_lowerrS�s*��"�=�=�?�?� � �"�"�)�)�+�+�+rc���t�|�dd����}t�fd�|D����S)zDReturn whether element has a ``rel`` attribute with given link type.�relrc3�>�K�|]}t|���kV��dS)N)rS)�.0�token�	link_types  �r�	<genexpr>z(element_has_link_type.<locals>.<genexpr>�s0�����C�C�5�{�5�!�!�Y�.�C�C�C�C�C�Cr)�SPACE_SEPARATED_TOKENS_RE�findall�get�any)�elementrY�tokenss ` r�element_has_link_typera�sG���
&�
.�
.�w�{�{�5�"�/E�/E�
F�
F�F��C�C�C�C�F�C�C�C�C�C�Crc�^�|jtvrt|j||||��S|gS)zbHandle HTML elements that need special care.

    :returns: a (possibly empty) list of boxes.
    )�element_tag�
HTML_HANDLERS�tag)r_�box�get_image_from_uri�base_urls    r�handle_elementri�s=��
��-�'�'��W�[�)��S�,�h�8�8�	8��u�rc����fd�}|S)zDReturn a decorator registering a function handling ``tag`` elements.c���|t�<|S)z;Decorator registering a function handling ``tag`` elements.)rd)�functionres �r�	decoratorzhandler.<locals>.decorator�s���%�
�c���r�)rerms` r�handlerro�s$���������rc��d|jdvrtjntj}||j|j||��}|j|_|j|_|S)z�Wrap an image in a replaced box.

    That box is either block-level or inline-level, depending on what the
    element should be.

    �block�display)�styler�BlockReplacedBox�InlineReplacedBoxre�
string_set�bookmark_label)r_rf�image�type_�new_boxs     r�make_replaced_boxr{�s`��#*�S�Y�y�-A�"A�"A����
�
$�
��e�G�K���G�U�;�;�G���G�� �/�G���Nr�imgc�v�t|d|��}|�d��}|re|||jd���}|�t|||��gS|r)tj�||��g|_|gS|dkrgS|�J�gS|r)tj�||��g|_|gSgS)z�Handle ``<img>`` elements.

    Return either an image or the alt-text.

    See: https://www.w3.org/TR/html5/embedded-content-1.html#the-img-element

    �src�alt�image_orientation)�url�orientationNr)rr]rsr{r�TextBox�anonymous_from�children)r_rfrgrhr~rrxs       r�
handle_imgr��s����G�U�H�
5�
5�C�
�+�+�e�
�
�C�
��"�"����+>�!?�A�A�A����%�g�s�E�:�:�;�;��

� %�
� <� <�S�#� F� F�G����u�������	��{�{�{��	��	�!�M�8�8��c�B�B�C�C�L��5�L��Ir�embedc���t|d|��}|�dd�����}|r-||||jd���}|�t	|||��gSgS)z�Handle ``<embed>`` elements, return either an image or nothing.

    See: https://www.w3.org/TR/html5/embedded-content-0.html#the-embed-element

    r~�typerr��r��forced_mime_typer��rr]r/rsr{)r_rfrgrhr~ryrxs       r�handle_embedr�s����G�U�H�
5�
5�C��K�K���#�#�)�)�+�+�E�
�<�"�"��e��	�"5�6�8�8�8����%�g�s�E�:�:�;�;�
�Ir�objectc���t|d|��}|�dd�����}|r-||||jd���}|�t	|||��gS|gS)z�Handle ``<object>`` elements, return either an image or the fallback.

    See: https://www.w3.org/TR/html5/embedded-content-0.html#the-object-element

    �datar�rr�r�r�)r_rfrgrhr�ryrxs       r�
handle_objectr�s����W�f�h�7�7�D��K�K���#�#�)�)�+�+�E��<�"�"��u��	�"5�6�8�8�8����%�g�s�E�:�:�;�;��5�Lr�colgroupc���t�tj��r>td�|D����s%�fd�t	�j��D���_�gS)�Handle the ``span`` attribute.c3�,K�|]}|jdkV��dS)�colN)re)rW�childs  rrZz"handle_colgroup.<locals>.<genexpr>.s)����;�;�%�5�9��%�;�;�;�;�;�;rc�P��g|]"}tj��g����#Srn)r�TableColumnBoxr�)rW�_rfs  �r�
<listcomp>z#handle_colgroup.<locals>.<listcomp>/s<���*�*�*���$�3�3�C��<�<�*�*�*r)�
isinstancer�TableColumnGroupBoxr^�range�spanr��r_rf�_get_image_from_uri�	_base_urls `  r�handle_colgroupr�*st����#�u�0�1�1�*��;�;�7�;�;�;�;�;�	*�*�*�*�*��s�x���*�*�*�C�L�
�5�Lrr�c���t�tj��r+�jdkr �fd�t	�j��D��S�gS)r�rc�8��g|]}������Srn)�copy)rW�_irfs  �rr�zhandle_col.<locals>.<listcomp>;s!���5�5�5�r����
�
�5�5�5r)r�rr�r�r�r�s `  r�
handle_colr�5sO����#�u�+�,�,�6���A���6�5�5�5�U�3�8�_�_�5�5�5�5��5�Lrz{http://www.w3.org/2000/svg}svgc��|jd}|jd}	t||||��}t|||��gS#t$r7}t	jd|��t	jd|���gcYd}~Sd}~wwxYw)zUHandle ``<svg>`` elements.

    Return either an image or the fallback content.

    �url_fetcher�contextzFailed to load inline SVG: %szError while loading inline SVG:)�exc_infoN)�keywordsrr{�	Exceptionr
�error�debug)r_rfrgrhr�r�rx�	exceptions        r�
handle_svgr�?s���%�-�m�<�K� �)�)�4�G�8���(�K��A�A��"�'�3��6�6�7�7��������4�i�@�@�@���6��K�K�K�K��	�	�	�	�	�	��������s�A�
B�
,A<�6B�<Bc�$�d}d}d}g}g}d}d}g}i}	|jj�dd��}
|j�ddd��D�]�}|j}|jdkr|�t
|��}�'|jdkr�t|�dd����}|�dd��}
|d	krEtt|
�
d
����D]}||vr|�|�����|dkr|�|
����|dkr|�|
}��|d
kr|�|
}��|dkr|�t||
��}��|dkr|�t||
��}��|r	||	vr|
|	|<��)|jdkr�t|d��rpt|d|j��}|�dd��}|�t!jd�����t%|||j���}|�|�����|||||||||
|	d�
S)a2Get metadata dictionary out of HTML object.

    Relevant specs:

    https://www.whatwg.org/html#the-title-element
    https://www.whatwg.org/html#standard-metadata-names
    https://wiki.whatwg.org/wiki/MetaExtensions
    https://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions

    N�lang�title�meta�link�namer�contentr��,�author�description�	generatorzdcterms.createdzdcterms.modified�
attachment�hrefz'Missing href in <link rel="attachment">)r�r�r�)
r�r�r�r��authors�created�modified�attachmentsr��custom)�
etree_element�attribr]�wrapper_element�	query_allrer	rS�map�strip_whitespace�split�append�parse_w3c_daterarrhr
r�rr�)�htmlr�r�r�r�r�r�r�r�r�r�r_r�r��keywordr��attachment_titler�s                  r�get_html_metadatar�Ss���
�E��K��I��H��G��G��H��K�
�F���$�(�(���6�6�D��'�1�1�'�6�6�J�J�%/�%/���'���;�'�!�!�e�m�"�7�+�+�E�E�
�[�F�
"�
"��w�{�{�6�2�6�6�7�7�D��k�k�)�R�0�0�G��z�!�!�"�#3�W�]�]�3�5G�5G�H�H�1�1�G��h�.�.� ����0�0�0��1���!�!����w�'�'�'�'���&�&��&�")�K����$�$��$� '�I���*�*�*��?�,�T�7�;�;�G���+�+�+��#�-�d�G�<�<�H���
'�$�f�,�,�&��t���
�[�F�
"�
"�'<���('�('�
"�#�G�V�T�]�C�C�C�&�{�{�7�D�9�9���{���F�G�G�G�G�'��)9� $� 0�2�2�2�
��"�"�:�.�.�.���"������"�����rc�6�|�t��S)z�Use the HTML definition of "space character",
    not all Unicode Whitespace.

    https://www.whatwg.org/html#strip-leading-and-trailing-whitespace
    https://www.whatwg.org/html#space-character

    )r/r0rs rr�r��s���<�<�
�#�#�#raG
    ^
    [ 	

]*
    (?P<year>\d\d\d\d)
    (?:
        -(?P<month>0\d|1[012])
        (?:
            -(?P<day>[012]\d|3[01])
            (?:
                T(?P<hour>[01]\d|2[0-3])
                :(?P<minute>[0-5]\d)
                (?:
                    :(?P<second>[0-5]\d)
                    (?:\.\d+)?  # Second fraction, ignored
                )?
                (?:
                    Z |  # UTC
                    (?P<tz_hour>[+-](?:[01]\d|2[0-3]))
                    :(?P<tz_minute>[0-5]\d)
                )
            )?
        )?
    )?
    [ 	

]*
    $
c�j�t�|��r|Stjd||��dS)zYParse datetimes as defined by the W3C.

    See https://www.w3.org/TR/NOTE-datetime

    z#Invalid date in <meta name="%s"> %rN)�W3C_DATE_RErr
�warning)�	meta_namers  rr�r��sJ������ � �F��
���1�9�f�	F�	F�	F�	F�	Fr)<�__doc__�re�importlib.resourcesr�tinycss2.color3rrrrrr	�css.countersr
�formatting_structurer�imagesr�loggerr
�urlsr�HTML5_UA_COUNTER_STYLE�	read_text�HTML5_UA�
HTML5_UA_FORM�HTML5_PH�HTML5_UA_STYLESHEET�HTML5_UA_FORM_STYLESHEET�HTML5_PH_STYLESHEETr0�compiler[rr&rr!r(r9rArDrGrMrOrSrardriror{r�r�r�r�r�r�r�r��VERBOSEr�r�rnrr�<module>r�s
����
�	�	�	�%�%�%�%�%�%�'�'�'�'�'�'�"�"�"�"�"�"�"�"�"�"�������&�&�&�&�&�&�'�'�'�'�'�'�������������#�#�#�#�#�#�%������E�#�J�J��'�2�2�7�;�;����s���1�1�<�<�W�E�E�
��E�#�J�J��'�2�2�7�;�;���c��#9�;�;�;���3��(>�@�@�@���c��*�*�*���
�&�B�J�':�J�':�':�':�;�;��
�R�Z�:�Z�:�:�:�
;�
;�
��r�z�E�z�E�E�E�F�F��J�J�J�E�E�E�M�M�M�.�.�.�(
�
�
� *�*�*����	 �	 �	 �
$�
$�
$�,�,�,�(D�D�D��
�	�	�	�������$	�����!�!���!�H	����������$	����������$	����������	����������	��	*�+�+�8�8�,�+�8�&F�F�F�R$�$�$�$�b�j��2�Z�3���8
F�
F�
F�
F�
Fr

Youez - 2016 - github.com/yon3zu
LinuXploit