View Single Post
Old 03-02-2018, 12:52 AM   #7
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
You need to define "para break" in the CSS to get it to do something.

If you want to skip all that, using <p class="chapter"><p> as recommended by deback should do the trick.

This is what I'd do:

Search
Code:
(?ms)(.{400}.*?)(<p[ >])
Replace
Code:
\1<div class="chapter"></div>\2
The \1 and \2 corresponds to the search matches inside the parentheses:
Code:
\1: .{400}.*?
\2: <p[ >]
The above replacement regex basically inserts <div class="chapter"></div> between \1 and \2, and should match any paragraph regardless of class or style. Then convert via Calibre with Structure detection - Chapter mark - pagebreak.

Last edited by ilovejedd; 03-02-2018 at 12:57 AM.
ilovejedd is offline   Reply With Quote