You're fighting a losing battle with this sort of thing - my suggestion would be to figure out a pattern for the 'important' breaks instead of what you're trying to do. I assume these are most likely scene breaks. Then replace the important breaks with some sort of scene break marker, e.g. *** or <p> </p><p> </p>.
Then convert to text using Markdown or Textile, and finally convert back to ePub with the heuristic 'unwrap lines' option. That won't be perfect, but it will get you about as far as Calibre can take you by itself, and you can do final edits using Sigil.
|