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

Data Structures

class  HTMLSerializer
 
class  SerializeError
 

Functions

def htmlentityreplace_errors (exc)
 
def serialize (input, tree="etree", encoding=None, **serializer_opts)
 

Variables

 v
 

Function Documentation

◆ htmlentityreplace_errors()

def pip._vendor.html5lib.serializer.htmlentityreplace_errors (   exc)

◆ serialize()

def pip._vendor.html5lib.serializer.serialize (   input,
  tree = "etree",
  encoding = None,
**  serializer_opts 
)
Serializes the input token stream using the specified treewalker

:arg input: the token stream to serialize

:arg tree: the treewalker to use

:arg encoding: the encoding to use

:arg serializer_opts: any options to pass to the
    :py:class:`html5lib.serializer.HTMLSerializer` that gets created

:returns: the tree serialized as a string

Example:

>>> from html5lib.html5parser import parse
>>> from html5lib.serializer import serialize
>>> token_stream = parse('<html><body><p>Hi!</p></body></html>')
>>> serialize(token_stream, omit_optional_tags=False)
'<html><head></head><body><p>Hi!</p></body></html>'

Variable Documentation

◆ v

v