diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 18:15:17 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 18:15:17 -0500 |
commit | 1fa18e957db92cfa056151f4e0d93c44243df1d9 (patch) | |
tree | 3a41d6a36fb55e6a98320eb5ab6f65a4e307e0e4 /beautifulsoup/builder/_html5lib.py | |
parent | fe6a756f95d724456c368544949d41c16d0cc95b (diff) |
Started work on a tagging system that should make it easy to find a tree builder that meets your needs.
Diffstat (limited to 'beautifulsoup/builder/_html5lib.py')
-rw-r--r-- | beautifulsoup/builder/_html5lib.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/beautifulsoup/builder/_html5lib.py b/beautifulsoup/builder/_html5lib.py index 9cca0b0..020b7ea 100644 --- a/beautifulsoup/builder/_html5lib.py +++ b/beautifulsoup/builder/_html5lib.py @@ -2,7 +2,11 @@ __all__ = [ 'HTML5TreeBuilder', ] -from beautifulsoup.builder import HTMLTreeBuilder, SAXTreeBuilder +from beautifulsoup.builder import ( + ACCURATE, + HTML, + HTMLTreeBuilder, + ) import html5lib from html5lib.constants import DataLossWarning import warnings @@ -13,10 +17,11 @@ from beautifulsoup.element import ( Tag, ) - class HTML5TreeBuilder(HTMLTreeBuilder): """Use html5lib to build a tree.""" + tags = [ACCURATE, HTML] + def prepare_markup(self, markup, user_specified_encoding): # Store the user-specified encoding for use later on. self.user_specified_encoding = user_specified_encoding |