OpenQuizz
Une application de gestion des contenus pédagogiques
pip._vendor.html5lib.html5parser Namespace Reference

Data Structures

class  HTMLParser
 
class  ParseError
 

Functions

def parse (doc, treebuilder="etree", namespaceHTMLElements=True, **kwargs)
 
def parseFragment (doc, container="div", treebuilder="etree", namespaceHTMLElements=True, **kwargs)
 
def method_decorator_metaclass (function)
 
def getPhases (debug)
 
def adjust_attributes (token, replacements)
 
def impliedTagToken (name, type="EndTag", attributes=None, selfClosing=False)
 

Variables

 parser
 
 tree
 
 processSpaceCharacters
 
 originalPhase
 
 characterTokens
 

Function Documentation

◆ adjust_attributes()

def pip._vendor.html5lib.html5parser.adjust_attributes (   token,
  replacements 
)

◆ getPhases()

def pip._vendor.html5lib.html5parser.getPhases (   debug)

◆ impliedTagToken()

def pip._vendor.html5lib.html5parser.impliedTagToken (   name,
  type = "EndTag",
  attributes = None,
  selfClosing = False 
)

◆ method_decorator_metaclass()

def pip._vendor.html5lib.html5parser.method_decorator_metaclass (   function)

◆ parse()

def pip._vendor.html5lib.html5parser.parse (   doc,
  treebuilder = "etree",
  namespaceHTMLElements = True,
**  kwargs 
)
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>

◆ parseFragment()

def pip._vendor.html5lib.html5parser.parseFragment (   doc,
  container = "div",
  treebuilder = "etree",
  namespaceHTMLElements = True,
**  kwargs 
)
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>

Variable Documentation

◆ characterTokens

characterTokens

◆ originalPhase

originalPhase

◆ parser

parser

◆ processSpaceCharacters

processSpaceCharacters

◆ tree

tree