12-04-2014, 10:55 AM | #1 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Mar 2014
Device: Sony PRS-T2
|
Span Span Span Span
I frequently see epubs that have multiple spans-within spans-within spans-within spans ad nauseum. This goes on all through the file in every paragraph. I imagine this comes from the file being converted from some other format to epub. Other than looking ugly as heck and being extremely difficult to edit, does this kind of multiple nested spans affect how the file will perform on most readers? And is there an easy way to clean this kind of mess?
example: Quote:
Last edited by MULTIVAC; 12-04-2014 at 10:58 AM. |
|
12-04-2014, 10:17 PM | #2 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
That is soke nasty looking code. Chances are it came from a conversion of an old Mobi. The code in old Mobi can be that nasty.
It could be slower to render, but on most modern Readers such as your T2, you won't notice it. Personally, I'd give the code a good going over to get rid of all that garbage and redo the CSS so it matches what is supposed to happen. It's not that difficult if you can make use of search/replace/regex to get rid of the unwanted code. |
Advert | |
|
12-04-2014, 10:52 PM | #3 |
Grand Sorcerer
Posts: 12,176
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
In theory shouldn't one also look at the various CSS classes being used and ensure that any styling in them is combined?
|
12-05-2014, 03:24 AM | #4 |
Wizard
Posts: 4,332
Karma: 4000000
Join Date: Oct 2008
Location: Paris
Device: Cybooks; Sony PRS-T1
|
The one time i saw that, happened to be calibre generated code.
|
12-05-2014, 05:27 AM | #5 |
Fanatic
Posts: 563
Karma: 403106
Join Date: Aug 2014
Device: PRS-T1
|
I presume this comes from a document where, before converting in calibre, contains a lot of formatting.
|
Advert | |
|
12-05-2014, 05:47 AM | #6 |
Grand Sorcerer
Posts: 12,176
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
|
12-05-2014, 07:58 AM | #7 |
Wizard
Posts: 4,332
Karma: 4000000
Join Date: Oct 2008
Location: Paris
Device: Cybooks; Sony PRS-T1
|
|
12-06-2014, 08:58 AM | #8 | ||||||
Addict
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:
Quote:
If you get some more annoying code such as: Quote:
Quote:
Search for: Quote:
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:
|
||||||
Tags |
cleaning, editing, performance |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Nested Span? | Turtle91 | ePub | 4 | 05-20-2013 02:47 PM |
span in span: is this problematic? | tbuyus | ePub | 8 | 03-31-2013 08:01 AM |
Regex and span | JSWolf | Sigil | 7 | 01-23-2013 06:35 AM |
how do I span more than one line with regex | BartB | Sigil | 3 | 12-11-2011 05:12 PM |
Remove <br /> together with span, and only span | Razzia | Recipes | 3 | 05-30-2011 06:55 PM |