From f3beb946d517ba05e22ed3a928d9ac26b2047530 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 13 Jun 2017 14:42:38 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/polish/parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/parsing.py b/src/calibre/ebooks/oeb/polish/parsing.py index 3d505763a1..1fa94c8d4e 100644 --- a/src/calibre/ebooks/oeb/polish/parsing.py +++ b/src/calibre/ebooks/oeb/polish/parsing.py @@ -622,7 +622,7 @@ def html5_parse(raw, decoder=None, log=None, discard_namespaces=False, line_numb raw = raw.replace('\r\n', '\n').replace('\r', '\n') raw = replace_chars.sub('', raw) from html5_parser import parse - root = parse(raw, maybe_xhtml=not discard_namespaces, line_number_attr=linenumber_attribute, keep_doctype=False) + root = parse(raw, maybe_xhtml=not discard_namespaces, line_number_attr=linenumber_attribute, keep_doctype=False, sanitize_names=True) if (discard_namespaces and root.tag != 'html') or ( not discard_namespaces and (root.tag != '{%s}%s' % (namespaces['html'], 'html') or root.prefix)): raise ValueError('Failed to parse correctly, root has tag: %s and prefix: %s' % (root.tag, root.prefix))