View Single Post
Old 04-28-2024, 08:55 AM   #1
Astroman
Junior Member
Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.Astroman can tame squirrels without the assistance of a chair or a whip.
 
Posts: 5
Karma: 11018
Join Date: Feb 2024
Device: none
Exclamation Non-breaking Space numerical entity NOT preserved after generating TOC

An issue has popped up where Sigil, seemingly at random, has converted about half of all cases of the Non-breaking Space numerical entity (already included in Preserve Entities!) to a very hard to see, red, broken underline symbol.

After 8 hours of investigating, I have found a way to easily reproduce the issue.

Details and background (excuse my less-than-perfect English):
I've copied text from my plain text editor into Sigil's Code View and added basic formatting like headings, paragraphs and lists. Nothing fancy, as I like to keep things simple and not introduce complicated styling that might not work in some EPUB reading apps. I'll add lots of images later, but 80% of the text is now imported and formatted. This is my first time using Sigil. I have read the entire Sigil User Guide twice, plus searched the user forum.

My e-book (EPUB version 3) is about astronomy and contains lots of numbers, units of measurement and symbols. Non-breaking space is often needed in these kind of expressions. It's not optional, it's a must. (I frequently use non-breaking space on my astronomy website as well.)

In Sigil's preferences, the Preserve Entities list already contains the numerical entity (& # 160; – obviously without the spaces), so according to the user guide, this would preserve this entity and prevent Mend from converting it to a Unicode character.

I made a clip containing the numerical entity and added non-breaking spaces here and there. In total, my document contained 295 non-breaking spaces, coded as the above-mentioned numerical entity. After closing, opening, editing various chapters, and saving many times, I could clearly see in Code View that the numerical entity was present. Great!

However, when I opened Sigil yesterday, I saw that many of the instances of non-breaking space were gone! Or rather, some had been converted to a red, broken underline symbol, which I later found out is the same as when using the Insert Special Character panel. The underline is extremely thin and hard to see. Using Find I discovered that 150 of the 295 cases of non-breaking space had been converted from the numerical entity to the almost invisible underline symbol.

Luckily, all non-breaking spaces seem to work as they should when checking in Preview. But since this character is so important in my book, I would really have liked to be able to clearly see it in Code View, i.e. I would like Sigil to respect the Preserve Entities list, which, even as default, include this particular numerical identity.

I didn't understand why this had happened. Why is the numerical entity not preserved, and why have half of them been converted (0% or 100% would make more sense)? Even in a single short chapter, some cases have been converted, some not. I couldn't make sense of it.

Please note that I have not changed anything in Sigil's Basics setting, i.e. "Mend Not Well Formed HTML Source Code ON" has both boxes (Open and Save) ticked.

I will run various tools and checks before publishing my e-book, but so far I have not used any of the "Reformat" or "Check" tools in the Tools meny.

The culprit?:
The only thing I have actively run, is Generate Table of Contents. I did that for the first time a few days ago, so I wondered if that might have had an impact. Using a demo file, I found out that Sigil preserves the non-breaking space numerical entity when editing, saving, closing and opening the file. However, after using Generate Table of Contents, about half of them are converted to the thin, underline symbol!

Maybe this inconsistency is a bug?
Astroman is offline   Reply With Quote