From c0609cd4cde44169b96e18df48178e5bf7187878 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Oct 2010 15:03:22 -0600 Subject: [PATCH] Smarten punctuation: Fix bug in handling of comments --- src/calibre/ebooks/conversion/preprocess.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index c5ebae4bba..bb8bf596d0 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -543,6 +543,13 @@ class HTMLPreProcessor(object): def smarten_punctuation(self, html): from calibre.utils.smartypants import smartyPants from calibre.ebooks.chardet import substitute_entites + from uuid import uuid4 + start = 'calibre-smartypants-'+str(uuid4()) + stop = 'calibre-smartypants-'+str(uuid4()) + html = html.replace('', stop) html = smartyPants(html) + html = html.replace(start, '') return substitute_entites(html)