FB2 Output: Fix generation of FB2 sections based on a multi-level Table of Contents in the input document. Fixes #1393514 [Incorrect nesting of sections in FB2 output](https://bugs.launchpad.net/calibre/+bug/1393514)

This commit is contained in:
Kovid Goyal 2014-12-24 05:53:54 +05:30
parent caf343b826
commit f715fe8dd8

View File

@ -435,7 +435,7 @@ class FB2MLizer(object):
# Start a new section if necessary
if newlevel:
if not (newlevel > self.section_level):
while newlevel <= self.section_level:
fb2_out.append('</section>')
self.section_level -= 1
fb2_out.append('<section>')