From d1be20bae38b58072ed5e2e0ae110aaf3306ee72 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 May 2016 18:19:30 +0530 Subject: [PATCH] Fix #1579507 [NY Time recipe fails to download](https://bugs.launchpad.net/calibre/+bug/1579507) --- src/calibre/ebooks/oeb/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index e35869eb9b..e9b97a9e4d 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -352,7 +352,7 @@ def escape_cdata(root): pat = re.compile(r'[<>&]') for elem in root.iterdescendants('{%s}style' % XHTML_NS, '{%s}script' % XHTML_NS): if elem.text and pat.search(elem.text) is not None: - elem.text = etree.CDATA(elem.text) + elem.text = etree.CDATA(elem.text.replace(']]>', r'\]\]\>')) def serialize(data, media_type, pretty_print=False): if isinstance(data, etree._Element):