summaryrefslogtreecommitdiff
path: root/beautifulsoup/builder/lxml_builder.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-13 20:00:33 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-13 20:00:33 -0500
commit5aa0e5ba8ec6a590c673db54c60ff2a76544f14f (patch)
treebf0637e79bc667a1b5ae08ca4794df414f169992 /beautifulsoup/builder/lxml_builder.py
parent87a55b145f0a73e6fc9ede9a762d81d2527161b6 (diff)
parentbc97bb3a83ee9fb4c8e31d11069ccf1cda61d4ff (diff)
Fixed handling of doctypes and added tests for nonsensical declarations.
Diffstat (limited to 'beautifulsoup/builder/lxml_builder.py')
-rw-r--r--beautifulsoup/builder/lxml_builder.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/beautifulsoup/builder/lxml_builder.py b/beautifulsoup/builder/lxml_builder.py
index 4e83bba..9ced9f0 100644
--- a/beautifulsoup/builder/lxml_builder.py
+++ b/beautifulsoup/builder/lxml_builder.py
@@ -6,8 +6,8 @@ class LXMLTreeBuilder(HTMLTreeBuilder):
def __init__(self, parser_class=etree.HTMLParser):
# etree.HTMLParser's constructor has an argument strip_cdata,
- # but it does nothing. CDATA sections will become text when
- # passed through etree.HTMLParser.
+ # but it does nothing. CDATA sections are always stripped when
+ # passed through HTMLParser.
self.parser = parser_class(target=self)
self.soup = None
@@ -32,8 +32,8 @@ class LXMLTreeBuilder(HTMLTreeBuilder):
def doctype(self, name, pubid, system):
self.soup.endData()
- self.soup.handle_data(name)
- self.soup.endData(Doctype)
+ doctype = Doctype.for_name_and_ids(name, pubid, system)
+ self.soup.object_was_parsed(doctype)
def comment(self, content):
"Handle comments as Comment objects."