U o a @ s d dl mZmZmZ d dlmZmZ d dlZd dlm Z ddl mZ ddl mZ ddl m Z dd lmZ dd l mZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z" d!ddZ#d"ddZ$dd Z%G dd de&Z'ej(dd Z)dd Z*d#ddZ+G dd d e,Z-dS )$ )absolute_importdivisionunicode_literals)with_metaclassviewkeysN)OrderedDict )_inputstream) _tokenizer)treebuilders)Marker)_utils)spaceCharactersasciiUpper2LowerspecialElementsheadingElements cdataElementsrcdataElements tokenTypes tagTokenTypes namespaceshtmlIntegrationPointElements"mathmlTextIntegrationPointElementsadjustForeignAttributesadjustMathMLAttributesadjustSVGAttributesE_ReparseExceptionetreeTc K s$ t |}t||d}|j| f|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('
This is a doc
')