From abe408bc3943f46fa083cf1f5a86fb71edb15388 Mon Sep 17 00:00:00 2001 From: Andrey Efremov Date: Tue, 8 Oct 2019 11:11:13 +0700 Subject: [PATCH] FB2 Output: Dedent the header to position it on the same level as the body --- src/calibre/ebooks/fb2/fb2ml.py | 49 +++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index 2a408c3f94..a9d604da65 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -200,32 +200,33 @@ class FB2MLizer(object): from calibre.utils.html2text import html2text metadata['comments'] = '

{}

'.format(prepare_string_for_xml(html2text(comments.value).strip())) + # Keep the indentation level of the description the same as the body. header = textwrap.dedent('''\ - - - %(genre)s - %(author)s - %(title)s - %(cover)s - %(lang)s - %(keywords)s - %(sequence)s - %(comments)s - - - %(author)s - %(appname)s %(version)s - %(date)s - %(id)s - 1.0 - - - %(publisher)s - %(year)s - %(isbn)s - - ''') % metadata + + + %(genre)s + %(author)s + %(title)s + %(cover)s + %(lang)s + %(keywords)s + %(sequence)s + %(comments)s + + + %(author)s + %(appname)s %(version)s + %(date)s + %(id)s + 1.0 + + + %(publisher)s + %(year)s + %(isbn)s + + ''') % metadata # Remove empty lines. return '\n'.join(filter(unicode_type.strip, header.splitlines()))