From db4416a73692f72cd491b49f0735cd3242c62688 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Jan 2012 17:24:33 +0530 Subject: [PATCH] MOBI Output: Do not collapse whitespace when setting the comments metadata in newly created MOBI files --- src/calibre/ebooks/mobi/writer2/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer2/main.py b/src/calibre/ebooks/mobi/writer2/main.py index 93b3987971..a4dac33d94 100644 --- a/src/calibre/ebooks/mobi/writer2/main.py +++ b/src/calibre/ebooks/mobi/writer2/main.py @@ -494,7 +494,9 @@ class MobiWriter(object): creators = [normalize(unicode(c)) for c in items] items = ['; '.join(creators)] for item in items: - data = self.COLLAPSE_RE.sub(' ', normalize(unicode(item))) + data = normalize(unicode(item)) + if term != 'description': + data = self.COLLAPSE_RE.sub(' ', data) if term == 'identifier': if data.lower().startswith('urn:isbn:'): data = data[9:]