View Single Post
Old 12-06-2014, 08:58 AM   #8
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
This code is really easy to get rid of just but simple search & replace in Calibre for:
Quote:
<span class="calibre26">
then
Quote:
<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:
Quote:
<p id="block_1"><b class="calibre_pb_1"></b></p>
in the next file you might see:
Quote:
<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:
Quote:
<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
Quote:
<p class="calibre25">
calibre25 css style.
odedta is offline   Reply With Quote