From 1fa18e957db92cfa056151f4e0d93c44243df1d9 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 20 Feb 2011 18:15:17 -0500 Subject: Started work on a tagging system that should make it easy to find a tree builder that meets your needs. --- beautifulsoup/builder/_html5lib.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'beautifulsoup/builder/_html5lib.py') 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 -- cgit v1.2.3