MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   nbsp disappeared (https://www.mobileread.com/forums/showthread.php?t=212681)

roger64 05-09-2013 02:46 AM

nbsp disappeared
 
Hi

I installed one week ago the latest Sigil 0.7.2 on LMDE 64 bits (Linux) from a deb made by DiapDealer.

I always use the same converter (writer2xhtml) to produce the EPUB from an odt file. This time, using exactly the same settings as usual, I converted my odt file to produce an EPUB. On a first look, everything seemed OK.

However, On opening it with Sigil, I realized something was missing: all the non breaking spaces (&-nbsp-; ) that I had placed on my odt file before converting to EPUB had disappeared on the target EPUB.

Does somebody know if this new version of Sigil "cleans" intently all these entities? I have turned Pretty print off and it still happens.

Still puzzled by what happened. Maybe Sigil has nothing to do with this. :chinscratch:

Moonraker 05-09-2013 04:55 AM

Recently, I have this problem too but I don't think it is Sigil causing it. I use:

<div class="scenechange">&nbsp; </div>

for extra white space between scene changes but the &nbsp; disappears after putting the epub through calibre leaving <div class="scenechange"></div>.

This causes the whitespace in epubs to be smaller than I wanted but they are okay in AZW3 files.

If I increase the top and bottom margins in the scenechange class in the CSS file they display better in epubs but too large in AZW3.

Toxaris 05-09-2013 05:23 AM

Why put an ePUB through Calibre? You are lucky, because a lot of readers will ignore tags with no content and will for sure not display an empty line.

Moonraker 05-09-2013 05:50 AM

Quote:

Why put an ePUB through Calibre? You are lucky, because a lot of readers will ignore tags with no content and will for sure not display an empty line.
Yes, I know. That's why I put &nbsp;_space_ in the <div class> tag then it's not empty. However, Calibre has recently been removing the &nbsp;_space_

theducks 05-09-2013 10:43 AM

Quote:

Originally Posted by Moonraker (Post 2508359)
Yes, I know. That's why I put &nbsp;_space_ in the <div class> tag then it's not empty. However, Calibre has recently been removing the &nbsp;_space_

Why use that construct at all?

If you are starting a new scene and you want a larger space from the preceding paragraph, give it its own class with a larger top margin... just like a FirstParagraph has its own treatment.
Code:

p.newscene { margin-top: 200%; }

roger64 05-09-2013 06:13 PM

Hi

It's recommended in French to pepper one's text with loads of non-breaking spaces. A 300 pages novel can have over two thousand of them... That's why I would be happy to know the reason why they all suddenly disappeared somewhere between OpenOffice and the opening of Sigil.

I had let survive - my mistake - some few <p>&nbsp;</p>. Even them were stripped and reduced to : <p> </p>. Extermination.

There is a &nbsp; serial killer somewhere... :eek:

Arios 05-09-2013 07:07 PM

Are you really sure that Sigil is the culprit?

It's could be the new patch_149 for writer2xhtml. What kind of cleaning option is enabled in Sigil (PPT or HT)?

Anyway, I use Sigil 0.7.2 since the first day and none of my "&nbsp;" have been ripped out.

Iznogood 05-09-2013 07:25 PM

And are you really sure that the &nbsp; really is gone? I stopped using Sigil because too many of my &mdash; were transformed into the utf-8 sign of the mdash (—). They still were m-dashes and displayed as m-dashes on my reader, but the text was impossible to work with because I had to switch to book view to see if a — glyph was an mdash or an ndash. Could it be that Sigil has transformed the &nbsp; into the utf-8 code for the non-breaking space, making it indistinguishable from a real space?

Turtle91 05-10-2013 02:04 AM

Quote:

Originally Posted by roger64 (Post 2509085)
It's recommended in French to pepper one's text with loads of non-breaking spaces. A 300 pages novel can have over two thousand of them...

Really?!?! That seems awfully strange. What purpose do they serve - other than to separate paragraphs? Are they to space out the words?? Sorry, I've never studied French, just German, Arabic, Korean, and some English ;) and am curious.

roger64 05-10-2013 02:38 AM

Quote:

Originally Posted by Turtle91 (Post 2509412)
Really?!?! That seems awfully strange. What purpose do they serve - other than to separate paragraphs? Are they to space out the words?? Sorry, I've never studied French, just German, Arabic, Korean, and some English ;) and am curious.

French language writers use them mainly with some punctuation signs, then for dates, numbers, civilities and some abbreviations. But we do not use them to separate paragraphs.

This is a good enough French introduction of their use.

Happily God invented Regexes... :)

@Iznoggod

It should not be a display problem. AFAIK, &nbsp; have never been hidden in Sigil, contrary to other entities like nnbsp. Once inserted again, they stay visible. But it could well be the explanation. My former &nbsp; seem to have been replaced by normal spaces.

@Arios

This happened
- using OpenOffice and unpatched writer2xhtml to EPUB
- using LibreOffice and 149_patched writer2xhtml to EPUB
which make me suspect it could be a Sigil trick.

For Sigil preferences, I keep PrettyPrint but I do not ask Sigil to check when opening and saving.

Jellby 05-10-2013 04:23 AM

Quote:

Originally Posted by Turtle91 (Post 2509412)
Really?!?! That seems awfully strange. What purpose do they serve - other than to separate paragraphs? Are they to space out the words??

They serve the very purpose they are intended for: to make a space non-breakable at line end.

Things like "We met at 2_PM", "This is Mr._Smith", "That was April_1st", etc. benefit from a non-breaking space in the place of the underscore. It is much better with real typesetting, though, because the whole paragraph can be adjusted in order to avoid the linebreaks at those points, and you don't actually notice that it was done. With current HTML (and ePub) renderer, however, it can often result in very large whitespaces in the line, so it is sometimes preferable to have those odd linebreaks instead.

Toxaris 05-10-2013 04:34 AM

So far I have not witnessed this behaviour at all. I use the &nbsp; sometimes, but it always work and never deleted.
To establish whether it is or isn't Sigil, you can do the following. Before opening the file in Sigil, check with a good HTML editor, Notepad++, or another program to your liking, if the &nbsp's are still there before opening in Sigil.

theducks 05-10-2013 11:43 AM

All my nbsp;'s are still there (even the ones I wished were regular spaces ;) )

Arios 05-10-2013 12:21 PM

Roger,

Could you use an older Sigil version (that worked adequately) to see what happen?

roger64 05-13-2013 02:20 AM

Quote:

Originally Posted by Arios (Post 2509926)
Roger,

Could you use an older Sigil version (that worked adequately) to see what happen?

To be frank, I did not believe in this solution. Not finding anything better, at last, I tried it. I installed the Windows 32 bits 0.5.3 version of Sigil and used it with Wine on my Linux box.

I created an EPUB file the usual way (LibreOffice - writer2xhtml). I opened it first with this above mentioned deprecated version of Sigil. The nbsp are here.

I opened this file with Sigil 0.7.2(Linux 64 bits). The nbsp are gone. I must add that when the EPUB has been saved, it keeps its nbsp and does not play the same trick again.

I will provide this thread with a small test EPUB so you can see if somebody can reproduce this.


All times are GMT -4. The time now is 07:50 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.