summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2016-07-26 22:01:22 -0400
committerLeonard Richardson <leonardr@segfault.org>2016-07-26 22:01:22 -0400
commit21d4cc074cc68fa3a37d04b746e19810cd5f296f (patch)
tree8071ec17e9d2309a38edca2621f9fcfba6a8a8ad
parent231c396236c3838c8e3c7ac40d6fba6f28fc00e5 (diff)
downloadbeautifulsoup4-21d4cc074cc68fa3a37d04b746e19810cd5f296f.tar.gz
Fixed a reported (but not duplicated) bug involving processing instructions fed into the lxml HTML parser.
-rw-r--r--NEWS.txt5
-rw-r--r--bs4/builder/_lxml.py4
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 184a56e..e46452d 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,8 @@
+= Unreleased =
+
+* Fixed a reported (but not duplicated) bug involving processing
+ instructions fed into the lxml HTML parser.
+
= 4.5.0 (20160719) =
* Beautiful Soup is no longer compatible with Python 2.6. This
diff --git a/bs4/builder/_lxml.py b/bs4/builder/_lxml.py
index 4495bb9..34bb14e 100644
--- a/bs4/builder/_lxml.py
+++ b/bs4/builder/_lxml.py
@@ -107,7 +107,8 @@ class LXMLTreeBuilderForXML(TreeBuilder):
# the document as each one in turn.
is_html = not self.is_xml
if is_html:
- self.processing_instruction_class = ProcessingInstruction
+ pass
+ # self.processing_instruction_class = ProcessingInstruction
else:
self.processing_instruction_class = XMLProcessingInstruction
try_encodings = [user_specified_encoding, document_declared_encoding]
@@ -235,6 +236,7 @@ class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML):
ALTERNATE_NAMES = ["lxml-html"]
features = ALTERNATE_NAMES + [NAME, HTML, FAST, PERMISSIVE]
+ processing_instruction_class = ProcessingInstruction
is_xml = False
def default_parser(self, encoding):