View Single Post
Old 12-02-2017, 06:24 PM   #15
blackest
Connoisseur
blackest began at the beginning.
 
Posts: 67
Karma: 10
Join Date: Sep 2014
Device: sony prs 2
I found this post which looks useful for the span problem

This code is really easy to get rid of just but simple search & replace in Calibre for:

<span class="calibre26">
then

<span class="calibre27">
and so on and so forth, after you're done you're left with a lot of </span>'s so just use "Beautify all files" function and voila, youre HTML files are clean.

If you get some more annoying code such as:

<p id="block_1"><b class="calibre_pb_1"></b></p>
in the next file you might see:

<p id="block_2"><b class="calibre_pb_2"></b></p>
notice the running numbers.. what you want to do is use regex search & replace (also available in calibre) and it goes like this:
Search for:

<p id="block_[0-9]*"><b class="calibre_pb_[0-9]*"></b></p>
Voila! those silly page breaks calibre makes are gone.

As for fixing the styling back to place, most of those spans calibre creates are repeated styling and usually contains only 2 rules, so it's rather easy to look at the CSS and see what kind of styling was applied on those spans and put them into the

<p class="calibre25">
calibre25 css style.
blackest is offline   Reply With Quote