View Single Post
Old 03-02-2018, 08:23 PM   #4
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,177
Karma: 8800000
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
I recommend useing the editor for finding split paragraphs and line feeds, this is the base search and replace I use:

Search
Code:
</p>\s*<p[^>]+>([a-z])
replace:
Code:
 \1
note the space at the beginning of the replace.

For extra line feeds I use a regex-fuction.

search:
Code:
<p class="(.*?)">(.*?)</p>|<div class="(.*?)">(.*?)</div>
regex-fuction
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return match.group().replace('\n', ' ')

bernie
gbm is offline   Reply With Quote