mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
a7ae71e41f
commit
98228ae614
@ -51,7 +51,7 @@ def load_html(path, view, codec='utf-8', mime_type=None,
|
|||||||
loading_url = QUrl.fromLocalFile(path)
|
loading_url = QUrl.fromLocalFile(path)
|
||||||
pre_load_callback(loading_url)
|
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)
|
view.setHtml(html, loading_url)
|
||||||
else:
|
else:
|
||||||
view.setContent(QByteArray(html.encode(codec)), mime_type,
|
view.setContent(QByteArray(html.encode(codec)), mime_type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user