From 2f0b16b8ea82b09034dff0e747e29d89e97b5680 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 20 Feb 2011 18:28:15 -0500 Subject: Tree builders now advertise their features. --- beautifulsoup/builder/_html5lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'beautifulsoup/builder/_html5lib.py') diff --git a/beautifulsoup/builder/_html5lib.py b/beautifulsoup/builder/_html5lib.py index 020b7ea..395fb9d 100644 --- a/beautifulsoup/builder/_html5lib.py +++ b/beautifulsoup/builder/_html5lib.py @@ -3,7 +3,7 @@ __all__ = [ ] from beautifulsoup.builder import ( - ACCURATE, + PERMISSIVE, HTML, HTMLTreeBuilder, ) @@ -20,7 +20,7 @@ from beautifulsoup.element import ( class HTML5TreeBuilder(HTMLTreeBuilder): """Use html5lib to build a tree.""" - tags = [ACCURATE, HTML] + features = [PERMISSIVE, HTML] def prepare_markup(self, markup, user_specified_encoding): # Store the user-specified encoding for use later on. @@ -55,7 +55,8 @@ class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder): def __init__(self, soup, namespaceHTMLElements): self.soup = soup if namespaceHTMLElements: - warnings.warn("namespaceHTMLElements not supported yet", DataLossWarning) + warnings.warn("namespaceHTMLElements not supported yet", + DataLossWarning) super(TreeBuilderForHtml5lib, self).__init__(namespaceHTMLElements) def documentClass(self): -- cgit v1.2.3 From 39a2b266b634aa2eca4329a6719e090087113f46 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 20 Feb 2011 19:25:15 -0500 Subject: Added tests for the default builder registry. --- beautifulsoup/builder/_html5lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'beautifulsoup/builder/_html5lib.py') diff --git a/beautifulsoup/builder/_html5lib.py b/beautifulsoup/builder/_html5lib.py index 395fb9d..175ea9b 100644 --- a/beautifulsoup/builder/_html5lib.py +++ b/beautifulsoup/builder/_html5lib.py @@ -20,7 +20,7 @@ from beautifulsoup.element import ( class HTML5TreeBuilder(HTMLTreeBuilder): """Use html5lib to build a tree.""" - features = [PERMISSIVE, HTML] + features = ['html5lib', PERMISSIVE, HTML] def prepare_markup(self, markup, user_specified_encoding): # Store the user-specified encoding for use later on. -- cgit v1.2.3 From 121361b1835a619ae03fce39cb5569f28968f1b0 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 20 Feb 2011 19:39:31 -0500 Subject: Started using the builder registry. --- beautifulsoup/builder/_html5lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'beautifulsoup/builder/_html5lib.py') diff --git a/beautifulsoup/builder/_html5lib.py b/beautifulsoup/builder/_html5lib.py index 175ea9b..f8a7a40 100644 --- a/beautifulsoup/builder/_html5lib.py +++ b/beautifulsoup/builder/_html5lib.py @@ -5,6 +5,7 @@ __all__ = [ from beautifulsoup.builder import ( PERMISSIVE, HTML, + HTML_5, HTMLTreeBuilder, ) import html5lib @@ -20,7 +21,7 @@ from beautifulsoup.element import ( class HTML5TreeBuilder(HTMLTreeBuilder): """Use html5lib to build a tree.""" - features = ['html5lib', PERMISSIVE, HTML] + features = ['html5lib', PERMISSIVE, HTML_5, HTML] def prepare_markup(self, markup, user_specified_encoding): # Store the user-specified encoding for use later on. -- cgit v1.2.3