title_body: Clean up converted ebook
upvoted_answer: Somehow I missed that … thanks to Donald.McLean’s answer, I found it.
  
  In the ePub editor, I hit Ctrl+F, and a search &amp; replace tool showed up at the bottom:
  
  
  
  I have used the regex mode and the following patterns:
  
  
  -&lt;/p&gt;\n&lt;p[^&gt;]*&gt; replaced with nothing to remove paragraph breaks within words. I hit Replace all here.
  \s&lt;/p&gt;\n&lt;p[^&gt;]*&gt; replaced with a single space to remove paragraph breaks within sentences. This had to be done manually, unfortunately, because there were some spaces at the end of lines which should stay separated.
  \n&lt;p[^&gt;]*&gt;\d+&lt;/p&gt; replaced with nothing to remove orphaned page numbers. Replace all again.
  
  
  I have also installed, but not yet tested, the plugin Modify ePub by Grant Drake. It offers some automated tasks: