From e101896e5720e58685633c3a5828cf88263ea323 Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 5 May 2011 06:49:36 -0400 Subject: [PATCH] HTMLZ: metadata replace metadata after merging. APNX don't use tag starting with d as paragraph tag as it breaks more than it fixes. --- src/calibre/devices/kindle/apnx.py | 2 +- src/calibre/ebooks/metadata/extz.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/kindle/apnx.py b/src/calibre/devices/kindle/apnx.py index ee519750e0..178c1091f3 100644 --- a/src/calibre/devices/kindle/apnx.py +++ b/src/calibre/devices/kindle/apnx.py @@ -164,7 +164,7 @@ class APNXBuilder(object): if c == '/': closing = True continue - elif c in ('d', 'p'): + elif c == 'p': if closing: in_p = False else: diff --git a/src/calibre/ebooks/metadata/extz.py b/src/calibre/ebooks/metadata/extz.py index 1bda263015..021450fca5 100644 --- a/src/calibre/ebooks/metadata/extz.py +++ b/src/calibre/ebooks/metadata/extz.py @@ -70,7 +70,7 @@ def set_metadata(stream, mi): # Update the metadata. old_mi = opf.to_book_metadata() old_mi.smart_update(mi) - opf.smart_update(metadata_to_opf(old_mi)) + opf.smart_update(metadata_to_opf(old_mi), replace_metadata=True) newopf = StringIO(opf.render()) safe_replace(stream, opf_path, newopf, extra_replacements=replacements, add_missing=True)