HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/bs4/__pycache__/formatter.cpython-311.pyc
�

��nc&����ddlmZGd�de��ZGd�de��ZGd�de��Zeej���ejd	<eejd
d���ejd
<eej���ejd<ed
���ejd
<eej���ejd	<eej���ejd<eeejd
�����ejd
<d
S)�)�EntitySubstitutionc�v�eZdZdZiZiZdZdZee	ddg�����Z
d�Z			dd�Zd
�Z
d�Zd�ZdS)�	FormatteraDescribes a strategy to use when outputting a parse tree to a string.

    Some parts of this strategy come from the distinction between
    HTML4, HTML5, and XML. Others are configurable by the user.

    Formatters are passed in as the `formatter` argument to methods
    like `PageElement.encode`. Most people won't need to think about
    formatters, and most people who need to think about them can pass
    in one of these predefined strings as `formatter` rather than
    making a new Formatter object:

    For HTML documents:
     * 'html' - HTML entity substitution for generic HTML documents. (default)
     * 'html5' - HTML entity substitution for HTML5 documents, as
                 well as some optimizations in the way tags are rendered.
     * 'minimal' - Only make the substitutions necessary to guarantee
                   valid HTML.
     * None - Do not perform any substitution. This will be faster
              but may result in invalid markup.

    For XML documents:
     * 'html' - Entity substitution for XHTML documents.
     * 'minimal' - Only make the substitutions necessary to guarantee
                   valid XML. (default)
     * None - Do not perform any substitution. This will be faster
              but may result in invalid markup.
    �html�xml�script�style)�cdata_containing_tagsc�V�|�|S||jkrt��S|j|S�N)�XML�set�
HTML_DEFAULTS)�self�language�value�kwargs    �/D:\Python311\Lib\site-packages\bs4/formatter.py�_defaultzFormatter._default*s5���	��L��t�x��	��5�5�L��!�%�(�(�N�/F�c��||_||_||_|�||d��|_||_|�d}t
|t��r|dkrd}d|z}nt
|t��r|}nd}||_	dS)a)Constructor.

        :param language: This should be Formatter.XML if you are formatting
           XML markup and Formatter.HTML if you are formatting HTML markup.

        :param entity_substitution: A function to call to replace special
           characters with XML/HTML entities. For examples, see 
           bs4.dammit.EntitySubstitution.substitute_html and substitute_xml.
        :param void_element_close_prefix: By default, void elements
           are represented as <tag/> (XML rules) rather than <tag>
           (HTML rules). To get <tag>, pass in the empty string.
        :param cdata_containing_tags: The list of tags that are defined
           as containing CDATA in this dialect. For example, in HTML,
           <script> and <style> tags are defined as containing CDATA,
           and their contents should not be formatted.
        :param blank_attributes_are_booleans: Render attributes whose value
            is the empty string as HTML-style boolean attributes.
            (Attributes whose value is None are always rendered this way.)

        :param indent: If indent is a non-negative integer or string,
            then the contents of elements will be indented
            appropriately when pretty-printing. An indent level of 0,
            negative, or "" will only insert newlines. Using a
            positive integer indent indents that many spaces per
            level. If indent is a string (such as "	"), that string
            is used to indent each level. The default behavior to
            indent one space per level.
        r
Nr� )
r�entity_substitution�void_element_close_prefixrr
�empty_attributes_are_booleans�
isinstance�int�str�indent)rrrrr
rr!s       r�__init__zFormatter.__init__1s���B!��
�#6�� �)B��&�%)�]�]��+�-D�&
�&
��"�,I��*��	��F��f�c�"�"�	���z�
����6�\�F�F�
���
$�
$�	��F�F��F�����rc��|js|Sddlm}t||��r|j�|jj|jvr|S|�|��S)aProcess a string that needs to undergo entity substitution.
        This may be a string encountered in an attribute value or as
        text.

        :param ns: A string.
        :return: A string with certain characters replaced by named
           or numeric entities.
        r)�NavigableString)r�elementr$r�parent�namer
)r�nsr$s   r�
substitutezFormatter.substituteesq���'�	��I�,�,�,�,�,�,��r�?�+�+�	��	�	��	��$�"<�<�	��I��'�'��+�+�+rc�,�|�|��S)z�Process the value of an attribute.

        :param ns: A string.
        :return: A string with certain characters replaced by named
           or numeric entities.
        )r))rrs  r�attribute_valuezFormatter.attribute_valueys�����u�%�%�%rc���|j�gSt�fd�t|j�����D����S)a�Reorder a tag's attributes however you want.
        
        By default, attributes are sorted alphabetically. This makes
        behavior consistent between Python 2 and Python 3, and preserves
        backwards compatibility with older versions of Beautiful Soup.

        If `empty_boolean_attributes` is True, then attributes whose
        values are set to the empty string will be treated as boolean
        attributes.
        Nc3�D�K�|]\}}|�jr|dkrdn|fV��dS)�N)r)�.0�k�vrs   �r�	<genexpr>z'Formatter.attributes.<locals>.<genexpr>�sU�����
�
���1���;�N��R��N���Q�P�
�
�
�
�
�
r)�attrs�sorted�list�items)r�tags` r�
attributeszFormatter.attributes�s`����9�	��I��
�
�
�
��S�Y�_�_�.�.�/�/�
�
�
�
�
�	
r)NNrNFr)�__name__�
__module__�__qualname__�__doc__�XML_FORMATTERS�HTML_FORMATTERS�HTMLr
�dictrrrr"r)r+r8�rrrrs���������8�N��O��D�
�C��D�!�c�8�W�"5�6�6����M�)�)�)�6:�AE�89�2�2�2�2�h,�,�,�(&�&�&�
�
�
�
�
rrc�&��eZdZdZiZ�fd�Z�xZS)�
HTMLFormatterzA generic Formatter for HTML.c�V��tt|��j|jg|�Ri|��Sr)�superrCr"r?�r�args�kwargs�	__class__s   �rr"zHTMLFormatter.__init__�s2���2�u�]�D�)�)�2�4�9�N�t�N�N�N�v�N�N�Nr�r9r:r;r<�REGISTRYr"�
__classcell__�rIs@rrCrC�sL�������'�'��H�O�O�O�O�O�O�O�O�OrrCc�&��eZdZdZiZ�fd�Z�xZS)�XMLFormatterzA generic Formatter for XML.c�V��tt|��j|jg|�Ri|��Sr)rErOr"r
rFs   �rr"zXMLFormatter.__init__�s2���1�u�\�4�(�(�1�$�(�L�T�L�L�L�V�L�L�LrrJrMs@rrOrO�sL�������&�&��H�M�M�M�M�M�M�M�M�MrrO)rrNT)rrr�html5�minimal)	�
bs4.dammitrrrCrO�substitute_htmlrK�substitute_xmlr
rArr�<module>rVs���)�)�)�)�)�)�O
�O
�O
�O
�O
�"�O
�O
�O
�bO�O�O�O�O�I�O�O�O�M�M�M�M�M�9�M�M�M�"/��*�:�"�"�"�
��v��#0�-�*�:�"�"&�#�#�#�
��w��
%2�M�*�9�%�%�%�
��y�!� -�}�� � � �
��t��".��*�:�"�"�"���f��$0�<�*�9�$�$�$���i� �(�i�
�I�i�m��6�6�6�����d���r