Skip to content

Commit c64a111

Browse files
Restore ability to provide a tree builder name as string (#559)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent 1b39377 commit c64a111

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

html5lib/html5parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ def __init__(self, tree=None, strict=False, namespaceHTMLElements=True, debug=Fa
115115

116116
if tree is None:
117117
tree = treebuilders.getTreeBuilder("etree")
118+
elif isinstance(tree, str):
119+
tree = treebuilders.getTreeBuilder(tree)
120+
118121
self.tree = tree(namespaceHTMLElements)
119122
self.errors = []
120123

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy