From 10b3353f57cea9f3bc18d29b367acedd05832162 Mon Sep 17 00:00:00 2001 From: ldolse Date: Tue, 14 Dec 2010 12:16:32 -0500 Subject: [PATCH] tweaked the ellipsis substitution --- src/calibre/ebooks/conversion/preprocess.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index bc4df4233a..3385771228 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -554,8 +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) + # convert ellipsis to entities to prevent wrapping + html = re.sub('(?u)(?<=\w)\s?(\.\s?){2}\.', '…', html) + # nbsp gets changed to space: html = re.sub('(?u)(?<=\w)\s(\.\s?){2}\.', ' …', html) return substitute_entites(html)