diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index 3ff816b3bf..bc4df4233a 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -554,5 +554,8 @@ class HTMLPreProcessor(object): html = smartyPants(html) html = html.replace(start, '') + # convert ellipsis to entities to prevent unwrapping + html = re.sub('(?u)(?<=\w)(\.\s?){3}', '…', html) + html = re.sub('(?u)(?<=\w)\s(\.\s?){3}', ' …', html) return substitute_entites(html)