From 852bd4945394242940948e4ed2e0efb759445ce4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Jul 2013 09:54:53 +0530 Subject: [PATCH] MOBI Input: Fix regression parsing ' MOBI Input: Fix a regression that broke parsing of MOBI files with malformed markup that also used entities for apostrophes. Fixes #1197585 [Private bug](https://bugs.launchpad.net/calibre/+bug/1197585) --- src/calibre/utils/soupparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/soupparser.py b/src/calibre/utils/soupparser.py index 403f57baad..efbcf8b970 100644 --- a/src/calibre/utils/soupparser.py +++ b/src/calibre/utils/soupparser.py @@ -62,7 +62,7 @@ def _parse(source, beautifulsoup, makeelement, **bsargs): if makeelement is None: makeelement = html.html_parser.makeelement if 'convertEntities' not in bsargs: - bsargs['convertEntities'] = 'html' + bsargs['convertEntities'] = 'xhtml' # Changed by Kovid, otherwise ' is mangled, see https://bugs.launchpad.net/calibre/+bug/1197585 tree = beautifulsoup(source, **bsargs) root = _convert_tree(tree, makeelement) # from ET: wrap the document in a html root element, if necessary