E-book viewer: Handle <![CDATA[ escapes correctly. Fixes #1550966 [ebook-viewer ignores content of script tag between <![CDATA[ and ]]>](https://bugs.launchpad.net/calibre/+bug/1550966)

This commit is contained in:
Kovid Goyal 2016-03-01 11:49:34 +05:30
parent a7ae71e41f
commit 98228ae614

View File

@ -51,7 +51,7 @@ def load_html(path, view, codec='utf-8', mime_type=None,
loading_url = QUrl.fromLocalFile(path)
pre_load_callback(loading_url)
if force_as_html or re.search(r'<[a-zA-Z0-9-]+:svg', html) is None:
if force_as_html or re.search(r'<[a-zA-Z0-9-]+:svg', html) is None and '<![CDATA[' not in html:
view.setHtml(html, loading_url)
else:
view.setContent(QByteArray(html.encode(codec)), mime_type,