
    ,h                        d dl mZ  G d de      Z G d de      Z G d de      Z eej
                        ej                  d	<    eej
                  d
      ej                  d<    eej                        ej                  d<    ed
      ej                  d
<    eej
                        ej                  d	<    eej                        ej                  d<    e eej                  d
            ej                  d
<   y
)    )EntitySubstitutionc                   f    e Zd ZdZi Zi ZdZdZ e e	ddg            Z
d Z	 	 dd	Zd
 Zd Zd Zy)	Formattera  Describes 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.
     * '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                 Z    ||S || j                   k(  r
t               S | j                  |   S N)XMLsetHTML_DEFAULTS)selflanguagevaluekwargs       O/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/bs4/formatter.py_defaultzFormatter._default)   s1    Ltxx5L!!%((    Nc                 ^    || _         || _        || _        | j                  ||d      | _        y)aZ  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.
        r
   N)r   entity_substitutionvoid_element_close_prefixr   r
   )r   r   r   r   r
   s        r   __init__zFormatter.__init__0   s5    ( !#6 )B&%)]]+-D&
"r   c                     | j                   s|S ddlm} t        ||      r0|j                  $|j                  j
                  | j                  v r|S | j                  |      S )a  Process 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.
           )NavigableString)r   elementr   
isinstanceparentnamer
   )r   nsr   s      r   
substitutezFormatter.substituteK   sU     ''I,r?+		%		$"<"<<I''++r   c                 $    | j                  |      S )zProcess the value of an attribute.

        :param ns: A string.
        :return: A string with certain characters replaced by named
           or numeric entities.
        )r#   )r   r   s     r   attribute_valuezFormatter.attribute_value_   s     u%%r   c                 H    t        |j                  j                               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.
        )sortedattrsitems)r   tags     r   
attributeszFormatter.attributesh   s     ciioo'((r   )NN/N)__name__
__module____qualname____doc__XML_FORMATTERSHTML_FORMATTERSHTMLr   dictr   r   r   r   r#   r%   r+    r   r   r   r      sU    6 NOD
C!8W"56M) 6:AE
6,(&)r   r   c                   &     e Zd ZdZi Z fdZ xZS )HTMLFormatterzA generic Formatter for HTML.c                 F    t        t        | 
  | j                  g|i |S r   )superr7   r   r3   r   argskwargs	__class__s      r   r   zHTMLFormatter.__init__u   s#    ]D2499NtNvNNr   r-   r.   r/   r0   REGISTRYr   __classcell__r=   s   @r   r7   r7   r   s    'HO Or   r7   c                   &     e Zd ZdZi Z fdZ xZS )XMLFormatterzA generic Formatter for XML.c                 F    t        t        | 
  | j                  g|i |S r   )r9   rC   r   r   r:   s      r   r   zXMLFormatter.__init__|   s#    \41$((LTLVLLr   r>   rA   s   @r   rC   rC   y   s    &HM Mr   rC   )r   r   N)r   r   html5minimal)	
bs4.dammitr   r   r7   rC   substitute_htmlr?   substitute_xmlr   r5   r   r   <module>rJ      s   )l)" l)^OI OM9 M "/*::"  v  #0*:: $#  w  %2*99%  y !  -   t  ".*::"  f  $0*99$  i   (imm6  d r   