From 6cd2a567f0e34faa2ce8c02de49d36c6be816d1b Mon Sep 17 00:00:00 2001 From: ldolse Date: Wed, 16 Feb 2011 06:55:39 +0800 Subject: [PATCH] replace nbsp indents before running smarten punctuation --- src/calibre/ebooks/conversion/preprocess.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index 6fafbb992e..32efa15b66 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -568,11 +568,14 @@ class HTMLPreProcessor(object): def smarten_punctuation(self, html): from calibre.utils.smartypants import smartyPants from calibre.ebooks.chardet import substitute_entites + from calibre.ebooks.conversion.utils import HeuristicProcessor + preprocessor = HeuristicProcessor(self.extra_opts, self.log) from uuid import uuid4 start = 'calibre-smartypants-'+str(uuid4()) stop = 'calibre-smartypants-'+str(uuid4()) html = html.replace('', stop) + html = preprocessor.fix_nbsp_indents(html) html = smartyPants(html) html = html.replace(start, '')