View Single Post
Old 04-26-2014, 02:59 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,539
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There's no way for calibre to know when a line break is "unwanted". You should include the newline you want removed as part of your regular expression, for example:

<p.+</p>(\n)?

Will remove <p> tag including an optional trailing newline.
kovidgoyal is offline   Reply With Quote