| 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/html5lib/__pycache__/ |
Upload File : |
�
V=�^�� � �, � d dl mZmZmZ d dlmZmZ d dlZddlm Z ddlm
Z
ddlmZ ddlm
Z
dd lmZ dd
lmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z dd�Z!dd�Z"d
� Z# G d� de$� Z%ejL d� � Z'd� Z( dd�Z) G d� de*� Z+y)� )�absolute_import�division�unicode_literals)�with_metaclass�viewkeysN� )�_inputstream)�
_tokenizer)�treebuilders)�Marker)�_utils)�spaceCharacters�asciiUpper2Lower�specialElements�headingElements�
cdataElements�rcdataElements�
tokenTypes�
tagTokenTypes�
namespaces�htmlIntegrationPointElements�"mathmlTextIntegrationPointElements�adjustForeignAttributes�adjustMathMLAttributes�adjustSVGAttributes�E�_ReparseExceptionc �l � t j |� }t ||�� } |j | fi |��S )a� Parse an HTML document as a string or file-like object into a tree
:arg doc: the document to parse as a string or file-like object
:arg treebuilder: the treebuilder to use when parsing
:arg namespaceHTMLElements: whether or not to namespace HTML elements
:returns: parsed tree
Example:
>>> from html5lib.html5parser import parse
>>> parse('<html><body><p>This is a doc</p></body></html>')
<Element u'{http://www.w3.org/1999/xhtml}html' at 0x7feac4909db0>
��namespaceHTMLElements)r �getTreeBuilder�
HTMLParser�parse)�doc�treebuilderr �kwargs�tb�ps �6/usr/lib/python3/dist-packages/html5lib/html5parser.pyr# r# s7 � �$
� $� $�[� 1�B��2�-B�C�A��1�7�7�3�!�&�!�!� c �p � t j |� }t ||�� } |j | fd|i|��S )a# Parse an HTML fragment as a string or file-like object into a tree
:arg doc: the fragment to parse as a string or file-like object
:arg container: the container context to parse the fragment in
:arg treebuilder: the treebuilder to use when parsing
:arg namespaceHTMLElements: whether or not to namespace HTML elements
:returns: parsed tree
Example:
>>> from html5lib.html5libparser import parseFragment
>>> parseFragment('<b>this is a fragment</b>')
<Element u'DOCUMENT_FRAGMENT' at 0x7feac484b090>
r � container)r r! r"