That is a total mess. You might be able to clean up some of it by using calibre's ebook-editor to replace the <p></p> with a </p><p> basically reversing the two tags and then using the Beautify tool. Ditto for using Sigil as the editor except for using Mend and Prettify instead of Beautify. After this, you will still need to clean up the first paragraph and last paragraphs in each set.
|