From f4bbf10ee348fb7f998c20301073c7fadf0dac99 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 1 Jun 2010 19:49:53 -0600 Subject: [PATCH] LRF Input: Handle ampersands and other XML reserved characters correctly when converting LRF documents. Fixes #4923 (Ampersands in input text get lost in output) --- src/calibre/ebooks/lrf/objects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/lrf/objects.py b/src/calibre/ebooks/lrf/objects.py index 0045e679a3..8f69e94013 100644 --- a/src/calibre/ebooks/lrf/objects.py +++ b/src/calibre/ebooks/lrf/objects.py @@ -3,7 +3,7 @@ __copyright__ = '2008, Kovid Goyal ' import struct, array, zlib, cStringIO, collections, re from calibre.ebooks.lrf import LRFParseError, PRS500_PROFILE -from calibre import entity_to_unicode +from calibre import entity_to_unicode, prepare_string_for_xml from calibre.ebooks.lrf.tags import Tag ruby_tags = { @@ -870,7 +870,7 @@ class Text(LRFStream): open_containers = collections.deque() for c in self.content: if isinstance(c, basestring): - s += c + s += prepare_string_for_xml(c) elif c is None: if open_containers: p = open_containers.pop()