07-27-2017, 02:38 AM | #1 |
Groupie
Posts: 179
Karma: 1021404
Join Date: Apr 2010
Location: Stroud, UK
Device: Xgody tablet, LG G3 (Android), moon+reader
|
Where are the spaces going?
I've had this problem on and off for some time , but it's getting a bit annoying.
I have a book with dleiberate space lines in it: say (<p class="calibre8">& nbsp;</p>) or (<p class="calibre8">& #160;</p>) as a deliberate space line. At some stage I return to the page and find that the space symbol has gone - which means the line no longer produces a space once in book view!! At the same time ALL other space symbols have gone from the whole document . . . It appears to happen randomly even though I know it can't be the case. I have Sigil set to "automatically clean......." on 'open', and also set to 'pretty print tidy'. |
07-27-2017, 03:53 AM | #2 |
Grand Sorcerer
Posts: 5,596
Karma: 23164775
Join Date: Dec 2010
Device: Kindle PW2
|
You'll need to add to the list of entities to be preserved.
Edit > Preferences > Preserve Entities > Entities to Preserve (If you don't see this option, you'll need to update your Sigil version.) |
Advert | |
|
07-27-2017, 05:23 AM | #3 |
Groupie
Posts: 179
Karma: 1021404
Join Date: Apr 2010
Location: Stroud, UK
Device: Xgody tablet, LG G3 (Android), moon+reader
|
Hmm . . Thanks for that pointer - the nbsp was in the list, the #160 wasn't. I've added that and see if it makes a difference: I STILL have the old problem of the two entities swapping at random when editing - even when going from one chapter to another in the same book!
|
07-27-2017, 07:38 AM | #4 |
Grand Sorcerer
Posts: 27,583
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You're going to have a hard time preserving both and   in the same code in Sigil. Stick with one or the other--they represent the same exact character (no-break space) after all. Having both in your Preserve Entities preferences can certainly cause the harmless "swappiness" you're describing. I recommend you choose one or the other. I typically preserve/use in EPUB2s and   for EPUB3s.
|
07-27-2017, 09:41 AM | #5 | |
Groupie
Posts: 179
Karma: 1021404
Join Date: Apr 2010
Location: Stroud, UK
Device: Xgody tablet, LG G3 (Android), moon+reader
|
Quote:
Explain that to me and I'll be able to comprehend your post - otherwise I'm 'loster' than before I started the thread . . . . . |
|
Advert | |
|
07-27-2017, 09:53 AM | #6 |
Sigil Developer
Posts: 7,696
Karma: 5444398
Join Date: Nov 2009
Device: many
|
Under the spec, all entities are converted to their character representation during parsing. For most entities that is fine, but for some whitespace related entities, that would be problematic as you can then not differentiate a normal space from a non-breaking space on sight. To that end, Sigil users can choose to preserve entities (restore the entity representation in the text after parsing and serialization).
For epub2, named entities are allowed and so typically & nbsp ; is added to the list of entities to preserve. Upon first load, all non-breaking spaces will be converted to their named entitity equivalent. For epub3, only numeric entities are allowed (aside from the official xml named entities), so leaving & nbsp ; in an epub3 would result in warnings/errors from epubcheck. For epub3, Sigil users should use the numeric version of the entity (not the named entity version) to get a non-breaking space. This is typically written as & #160 ; although there are other hex based versions of the same thing. So again, on first load and on any other parsing/serializing activity, the non-breaking space characters will be converted to their numeric entity equivalent. If you are not seeing this, exactly what version of Sigil are you using? Just how old is it? Last edited by KevinH; 07-27-2017 at 10:13 AM. |
07-27-2017, 09:57 AM | #7 | |
Grand Sorcerer
Posts: 27,583
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
In the simplest terms, choose to preserve one or the other (and it MUST be   with EPUB3s)--not both--and they'll stop changing when you save. Last edited by DiapDealer; 07-27-2017 at 09:59 AM. |
|
07-28-2017, 02:25 AM | #8 |
Groupie
Posts: 179
Karma: 1021404
Join Date: Apr 2010
Location: Stroud, UK
Device: Xgody tablet, LG G3 (Android), moon+reader
|
I'm still on 0.8.6. I tried 0.9 versions but it kept doing things I didn't want (or even understand). I still sometimes use book view to edit - ever tried using code view to search for a few rogue '/'s or '<'s ? It just wouldn't cooperate for me.
At least now I seem to have a definitive answer as to the 'spontaneous' changes to the spaces. |
07-28-2017, 07:53 AM | #9 |
Groupie
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
|
My way of solving that, which seems to work for me while settling the argument between Sigil and Calibre as far as named spaces, was to just use <p><br/></p> instead.
Of course, if one of the more experienced and knowledgeable users here finds an issue with that, I'm always willing to re-think my solution. |
07-28-2017, 08:13 AM | #10 | |
Grand Sorcerer
Posts: 27,583
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
For the most part, I avoid using any of the various empty-ish paragraph strategies for creating vertical space altogether. I use css and css classes instead. |
|
07-28-2017, 08:33 AM | #11 | |
Groupie
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
|
Quote:
What I've ascertained since is, you can do your best to support everything out there, but something, like the ChiReader 6900, is going to decide it doesn't like what you've done, and would prefer to do it its own way. As far as the last part of your post, I have also developed a preference for that method as well. Now, whenever I open one of the older e-books I had created, I convert it to adhere to that. |
|
07-28-2017, 09:19 AM | #12 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Why don't you just avoid the problem by creating a paragraph style with margin-bottom or margin-top of 1 em?
|
07-28-2017, 09:34 AM | #13 | |
Sigil Developer
Posts: 7,696
Karma: 5444398
Join Date: Nov 2009
Device: many
|
Quote:
That said, given the huge number of bug fixes since the 0.8 series, I would strongly recommend using only the latest most recent version of Sigil. Sigil 0.9.8 is much much more stable than any earlier version, and current master (the next version) has even more serious (crashing) bugs fixed. And if there is something you do not understand, we can help. |
|
07-28-2017, 08:11 PM | #14 |
null operator (he/him)
Posts: 20,644
Karma: 26960534
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
07-29-2017, 03:01 AM | #15 | |
Groupie
Posts: 179
Karma: 1021404
Join Date: Apr 2010
Location: Stroud, UK
Device: Xgody tablet, LG G3 (Android), moon+reader
|
Quote:
.stara { margin-top: 1em; margin-bottom: 0.5em; font-size: 1em; text-align: center; text-indent: 1em; } Then, when needing a divider, 'JustinThought's line becomes: <p class="stara">* * * * *</p> Simple, efficient, visible and (so far!!) 100% faultless. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spaces between paragraphs | Bigo2 | Calibre | 15 | 06-25-2014 03:37 AM |
special spaces | exaltedwombat | Sigil | 6 | 03-02-2013 09:40 AM |
file name contains spaces | bmacklin | ePub | 3 | 09-20-2012 05:07 PM |
embedded spaces | rikm | Calibre | 1 | 06-03-2010 03:08 PM |
Non breaking spaces? | troymc | Sigil | 6 | 05-22-2010 07:47 AM |