View Single Post
Old 08-20-2014, 10:01 AM   #32
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by AlanHK View Post
I've got a book file full of code like :

Code:
<p class="calibre2"><span class="none2">blah blah blah</span></p>

Is there a way I can remove these spans, (the "none2" ones) to get

Code:
<p class="calibre2">blah blah blah</p>
without messing up any other spans?

I can remove the opening by simple s&r, but then I would have orphaned </span>, but could not just delete </span> without screwing up other spans.
Well as others have mentioned, solved this now.

1) Neuter the unwanted spans (convert to <span>) in Sigil or calibre code editor

2) Run it through the calibre plugin "Modify ePub"
https://www.mobileread.com/forums/sho...d.php?t=154371
applying "HTML/Strip spans", which removes that and other null tags.


Quote:
Originally Posted by "Modify ePub help"
Strip spans
Removes empty formatting elements (ie. <i/> or <b></b>) and SPAN elements that have no attributes.

This also converts empty container elements into self-closing elements (ie. <br></br> becomes <br/>).

Last edited by AlanHK; 08-20-2014 at 10:14 AM.
AlanHK is offline   Reply With Quote