![]() |
#1 |
Jus' Learnin'
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50
Karma: 5618
Join Date: Apr 2012
Location: Tucson, AZ
Device: none
|
![]()
I haven't found anything on this problem in the forum, but Sigil sometimes creates unnecessary code that makes no difference in how the paragraph is rendered. More than anything, it's annoying because I want clean CSS.
Example: <p class="first"><b style="font-size: 1em; line-height: 1.2em; text-indent: 0em;">EditorOne</b><span style="font-size: 1em; line-height: 1.2em; text-indent: 0em;"> is a freelance writer and editor . . . Frequently, when I insert bold or italic codes in the CSS, it is transformed later to include the style definition for whatever style has been defined before--sometimes paragraphs before. Its presence or absence does not affect the way the paragraph looks. (I work in code, not page view.) Example: <p><span style="font-size: 1em; line-height: 1.2em; text-indent: 2em;">I also couldn’t hide the fact that I was living off of $40.00 per week for food and any other items I needed. Forty dollars is all that I had left each week after paying my monthly minimums on credit cards (used for medical co-pays, fees for diagnostic testing, and prescription co-pays) along with other required bills we all have (like car insurance, gas, rent). It was there, in Guam, that my friends (my budding</span> <i style="font-size: 1em; line-height: 1.2em; text-indent: 2em;">'ohana</i><span style="font-size: 1em; line-height: 1.2em; text-indent: 2em;">) would develop the idea of putting together a fundraiser with the hope of paying off a quickly growing mountain of medical debt. The work of this group of educational consultants on my behalf led to new hope in ways I could have never imagined.</span><br /></p> These span styles restate the paragraph style from the stylesheet. I thought that span styles are used to interrupt the current applied style for an intentional change, not to simply restate the style for no purpose. However, today I found a span style that actually changed the size of the font in a paragraph which was not used anywhere in the previous or following paragraphs. These styles seem to appear spontaneously after I have closed and saved and then open. Can anyone shed light on this? |
![]() |
![]() |
![]() |
#2 |
Jus' Learnin'
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50
Karma: 5618
Join Date: Apr 2012
Location: Tucson, AZ
Device: none
|
Here's an example I just found of one the weird ones:
<p style="line-height: 19px; font-size: 16px;"><span style="font-size: 1em; line-height: 1.2;">YouTube videos and a local news station, KITV, helped to spread the word, which resulted in contributions from complete strangers. The <i>One of Our Own</i> team had to invent it themselves. Again, at that time, there were no Kickstarter-like websites available.</span></p> I have not defined line height and font size in pixels. ??? |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Are you using WYSIWYG editing at all? If so, then you should be aware that WYSIWYG is not compatible with clean code, and that is pretty much definitely the problem.
If you aren't using WYSIWYG editing at all, Sigil should NOT be editing the code. (Aside from pretty print, which fixes up entities and doctypes and xml structure, but doesn't change HTML or CSS. Also, you can turn that off.) am pretty sure even opening up Book view will introduce some weird changes. Personally, I prefer the calibre editor. It allows you to work wholly in code view, without the temptation of Book view, and doesn't load the whole book in the editor on startup, and has global undo and checkpoints, and lots of other cool features. Last edited by eschwartz; 08-01-2014 at 03:11 PM. |
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,882
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I agree with eschwartz, using the WYSWYG can introduce those spans in some cases: Like joining 2 paragraphs using the delete key at the end of the first part.
I use Book view to help sync the cursor to the code where I do the real join. Fixing a single letter is about all I attempt in Book view as other unwanted artifacts can appear ![]() |
![]() |
![]() |
![]() |
#5 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
That is why the calibre editor doesn't even attempt these sorts of things. There is not absolute answer to the problem that doesn't introduce another problem.
When you enter text directly in the book view, you are asking it to guess what you want. It is doing its best, but it isn't pretty. But any similar program will have the same difficulties. Editing is best done in a word processor which then is published to an epub, using Toxaris' Word add in or AWP or Jutoh. They place the conversion at the end of all your editing, rather than the ongoing conversion of Sigil. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,945
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But remember, garbage in, garbage out. You source code has some of this garbage in it to start.
|
![]() |
![]() |
![]() |
#7 |
Jus' Learnin'
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50
Karma: 5618
Join Date: Apr 2012
Location: Tucson, AZ
Device: none
|
Thanks, all. That gives me something to think about. As I said in the original post, I work in code view, not page view, although I frequently switch to page view to check how the output is shaping up. Maybe switching back and forth introduces the unwanted codes. I still have a lot to learn, but I've found that calibre often introduces multiple css entries in the style sheet for paragraphs that are identically formatted, which I consider garbage. I always clean up my style sheets to consolidate such duplications in a single style definition. It sometimes takes a while, but I like my style sheets clean and simple. Will check whether pretty print is on
|
![]() |
![]() |
![]() |
#8 | |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
You may be happy to learn, that the editor component is not the converter -- it shows you exactly what was in the book you opened, and changes nothing whatsoever. Even Sigil will automatically sort filetypes into Text, Images, Audio, etc. folders -- calibre has a tool you must manually run to do that. |
|
![]() |
![]() |
![]() |
Tags |
span, span styles, unnecessary code |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Arc Spontaneous Random Reboots | JD Gumby | Kobo Tablets | 7 | 08-18-2013 04:40 PM |
span in span: is this problematic? | tbuyus | ePub | 8 | 03-31-2013 08:01 AM |
Remove <br /> together with span, and only span | Razzia | Recipes | 3 | 05-30-2011 06:55 PM |
Unnecessary conversion | Helsing | Calibre | 9 | 09-04-2010 06:18 PM |