10-20-2012, 01:18 PM
I have have an ePub in which literally every tag has a span within it without a class attribute. For example, <p class="xxx"><span>Some text</span></p>.
What purpose could those spans serve? I am considering remove them all.--MH
Wild guess: having it displayed correctly in iBooks. Obviously it is a bad coding habit but also those who coded rendering engines not adhering to the standards did a poor job... (See this recent thread: http://www.mobileread.com/forums/showpost.php?p=2272513 )
10-20-2012, 02:18 PM
Note that there may be selectors targeting those spans without class, for example "p span" means any <span> within a <p>, with or without class.
But of course, if the code is so crappy, I doubt the CSS has such a sophistication.
10-20-2012, 07:01 PM
Save your epub with another name and then pull out all the junk.
Then see what you have and whether you like it. Be sure to display it in your reader or in the Sony Library. Sigil is not a reliable guide to how things will display.
do you know which program was used to generate the epub? i'm not totally certain, but feel like i've seen an over-abundance of <span> tags sometimes produced by indesign's export to epub. also completely a wild guess, but perhaps there had been a style applied to the text in indesign, but the indesign style itself contained no information...?
but yes, back up, try removing them all and see if it changes the layout.
11-02-2012, 10:42 AM
I have removed the <span>s with no ill effects. I have not tried this ePub on an iPad mostly because I don't have one.
Not sure what generated the file. It is a published ebook I am trying to remove some annoying artifacts from.