diff options
-rw-r--r-- | NEWS.txt | 5 | ||||
-rw-r--r-- | bs4/builder/_lxml.py | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -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): |