From eec398a8c505e99f42c797148d0474f59004f277 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Dec 2014 12:42:11 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/widgets.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/widgets.py b/src/calibre/gui2/tweak_book/widgets.py index 56adb49dff..d2788703d6 100644 --- a/src/calibre/gui2/tweak_book/widgets.py +++ b/src/calibre/gui2/tweak_book/widgets.py @@ -252,10 +252,9 @@ class ImportForeign(Dialog): # {{{ def make_highlighted_text(emph, text, positions): positions = sorted(set(positions) - {-1}, reverse=True) - text = prepare_string_for_xml(text) for p in positions: ch = get_char(text, p) - text = '%s%s%s' % (text[:p], emph, ch, text[p+len(ch):]) + text = '%s%s%s' % (prepare_string_for_xml(text[:p]), emph, ch, prepare_string_for_xml(text[p+len(ch):])) return text