summaryrefslogtreecommitdiff
path: root/src/lxml/html/html5parser.py
diff options
context:
space:
mode:
authorhankthetank <henke@mac.se>2011-11-04 00:04:06 +0100
committerhankthetank <henke@mac.se>2011-11-04 00:04:06 +0100
commitbc7fdc5329511f99dc2cd2fd925104d1fc363805 (patch)
treeab29656926ae9eae2375a01fba17747de53dec8e /src/lxml/html/html5parser.py
parent5fc9eac1edea42ec46422c6c7b017ee11c4a9531 (diff)
downloadpython-lxml-bc7fdc5329511f99dc2cd2fd925104d1fc363805.tar.gz
Added support for passing kwargs into html5lib parser. I.e lxml.html.html5parser.HTMLParser(namespaceHTMLElements=False) which is needed in order to avoid the <html:div> namespacing.
Diffstat (limited to 'src/lxml/html/html5parser.py')
-rw-r--r--src/lxml/html/html5parser.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lxml/html/html5parser.py b/src/lxml/html/html5parser.py
index 970ef8c9..b40f5512 100644
--- a/src/lxml/html/html5parser.py
+++ b/src/lxml/html/html5parser.py
@@ -20,8 +20,8 @@ except NameError:
class HTMLParser(_HTMLParser):
"""An html5lib HTML parser with lxml as tree."""
- def __init__(self, strict=False):
- _HTMLParser.__init__(self, strict=strict, tree=TreeBuilder)
+ def __init__(self, strict=False, **kwargs):
+ _HTMLParser.__init__(self, strict=strict, tree=TreeBuilder, **kwargs)
try:
@@ -32,8 +32,8 @@ else:
class XHTMLParser(_XHTMLParser):
"""An html5lib XHTML Parser with lxml as tree."""
- def __init__(self, strict=False):
- _XHTMLParser.__init__(self, strict=strict, tree=TreeBuilder)
+ def __init__(self, strict=False, **kwargs):
+ _XHTMLParser.__init__(self, strict=strict, tree=TreeBuilder, **kwargs)
xhtml_parser = XHTMLParser()