View Single Post
Old 04-02-2014, 07:17 PM   #598
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Quote:
Originally Posted by Rev. Bob View Post
If I grok that script correctly, it looks like I can expand it to remove the Kobo spans just by changing this line (23):

Code:
if entity == '<span>':
to this:

Code:
if entity == '<span>' or entity[:17] == '<span class="kobo' or entity[:15] == '<span id="kobo.':
In other words, match no-attribute spans, spans where the first attribute is a class beginning with 'kobo', and spans where the first attribute is an ID beginning with 'kobo.' - yes?

If that'll do the trick, it should match the Kobo books I've seen (class first), those PeterT's got (id first), and it'll strip out empty spans in the bargain. Not bad for one changed line...

ETA: Never mind; the further enhancement I had in mind wouldn't work. Ignore this ETA line.
Yep, that should do it.

IIRC - When doing it originally (ages ago) I was going to add a few other cases that may have been useful, but left it as it was as it worked as needed at the time.
Perkin is offline   Reply With Quote