← Back
Editing: _html5lib.cpython-311.pyc
� � �c�J � �d � d Z dgZddlZddlZddlmZmZmZmZm Z ddl mZmZ ddl Z ddlmZmZ ddl mZmZmZmZ ddlmZ d Zn# e$ rZdd lmZ dZY dZ[ndZ[ww xY w G d� de � � Z G d � dej � � Z G d� de� � Z G d� dej! � � Z" G d� de"� � Z#dS )�MIT�HTML5TreeBuilder� N)�DetectsXMLParsedAsHTML� PERMISSIVE�HTML�HTML_5�HTMLTreeBuilder)�NamespacedAttribute�nonwhitespace_re)� namespaces�prefixes)�Comment�Doctype�NavigableString�Tag)�_baseF)�baseTc �B � e Zd ZdZdZeeeegZdZ d d�Z d� Zd� Zd� Z dS ) r a Use html5lib to build a tree. Note that this TreeBuilder does not support some features common to HTML TreeBuilders. Some of these features could theoretically be implemented, but at the very least it's quite difficult, because html5lib moves the parse tree around as it's being built. * This TreeBuilder doesn't use different subclasses of NavigableString based on the name of the tag in which the string was found. * You can't use a SoupStrainer to parse only part of a document. �html5libTNc # � K � || _ |rt j dd�� � t j |� � |d d dfV � d S )NzjYou provided a value for exclude_encoding, but the html5lib tree builder doesn't support exclude_encoding.� �� stacklevelF)�user_specified_encoding�warnings�warnr �warn_if_markup_looks_like_xml)�self�markupr �document_declared_encoding�exclude_encodingss �7/usr/lib/python3/dist-packages/bs4/builder/_html5lib.py�prepare_markupzHTML5TreeBuilder.prepare_markup@ sg � � � � (?��$� � ��M�|�� � � � � �<�V�D�D�D��t�T�5�)�)�)�)�)�)� c � � | j j �t j dd�� � t j | j �� � }|| j _ t � � }t |t � � st r| j |d<