MOBI Output: Do not collapse whitespace when setting the comments metadata in newly created MOBI files

This commit is contained in:
Kovid Goyal 2012-01-23 17:24:33 +05:30
parent 6a81e30de6
commit db4416a736

View File

@ -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:]