Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion html5lib/treebuilders/etree_lxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .. import _ihatexml

import lxml.etree as etree
import lxml.etree


fullTree = True
Expand Down Expand Up @@ -336,7 +337,7 @@ def insertRoot(self, token):
if self.doctype.name != token["name"]:
warnings.warn("lxml cannot represent doctype with a different name to the root element", DataLossWarning)
docStr += "<THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>"
root = etree.fromstring(docStr)
root = etree.fromstring(docStr, parser=lxml.etree.XMLParser(resolve_entities=False))

# Append the initial comments:
for comment_token in self.initial_comments:
Expand Down