Quote:
Originally Posted by kovidgoyal
Your patch will not work for the following reasons:
|
It worked at least for my test documents and the real book I wanted to convert in the first place.
Quote:
1) You need to use an OrderedDict not {}
|
That's correct. On my python implementation the simple dictionary seems to work the same way as the OrderedDict, but only by accident.
Quote:
2) if a file contains an <h2> as the first element and an <h1> after it, then the <h2> will be added to the <h1> from that file instead of the the <h1> from the previous file
|
Also correct, I didn't thought of that case during my tests.
I've now created such an epub with sigil and your implementation creates the correct TOC, while mine misplaces the <h2> as described.
Quote:
I have fixed both issues, but I haven't really tested my fix, so let me know if there are any problems.
|
Thanks, it works fine for me.
Ciao,
Steffen