Mobileread
entity replacements gone haywire
#1  lumpynose 05-19-2019, 04:39 PM
I had an em dash, written in the format "ampersand pound sign 8212 semicolon" and every time I opened or saved it was replacing the ampersand with & so that after awhile I ended up with

&a mp;amp;amp;amp;amp;amp;amp;amp;#8212;

I've since turned off the Mend XHTML source code on open and save as a workaround. I looked at my sigil.ini and it has

preserve_entity_names="*", "©", "&", "—"
preserve_entity_codes=\xa0\xa9&\x2014

(The web page forum software here replaced the entity codes above; in my sigil.ini they are in the "ampersand pound sign number semicolon" format. The first one, the asterisk, is number 160 in my sigil.ini file.)

In my preferences I have it set to create new epubs as version 3, validation levels for css are set to 3 for both.

Sigil version 5.11.2.
Reply 

#2  Doitsu 05-19-2019, 05:01 PM
@lumpynose

For some reason Sigil doesn't like the decimal notation of the em dash (—) but the hexadecimal equivalent — will survive if you add it to the Entities to Preserve list.
Reply 

#3  lumpynose 05-19-2019, 05:04 PM
Quote Doitsu
@lumpynose

For some reason Sigil doesn't like the decimal notation of the em dash (—) but the hexadecimal equivalent — will survive if you add it to the Entities to Preserve list.
Ok, I have to admit it; that made me laugh. I had no idea we could use hexidecimal or decimal.

Is octal also an option? Or maybe even binary?

But thanks, that's one to remember.
Reply 

#4  lumpynose 05-19-2019, 05:09 PM
Dammit, it won't let me use &#A9; or &#A0;, apparently only numerics.
Reply 

#5  lumpynose 05-19-2019, 05:11 PM
I wish sigil had 2 colums for that preserve entities window; the 2nd column for a comment saying what that gibberish in the first column means.
Reply 

#6  DiapDealer 05-19-2019, 05:50 PM
EPUB3 (html5) is numeric-only for entities. That's a spec thing.
Reply 

#7  lumpynose 05-19-2019, 05:52 PM
Quote DiapDealer
EPUB3 (html5) is numeric-only for entities. That's a spec thing.
So what am I doing wrong? I had to remove all of the numeric entities from my preferences in the Entities to Preserve window, otherwise it was mangling them and replacing the ampersands with amp; and whatnot.
Reply 

#8  lumpynose 05-19-2019, 05:56 PM
Quote DiapDealer
EPUB3 (html5) is numeric-only for entities. That's a spec thing.
In my xhtml files whenever I use the form "ampersand pound sign 38 semicolon" and save and reopen the file, sigil replaces that with "ampersand amp semicolon". In my preferences the Entities to Save is empty.
Reply 

#9  lumpynose 05-19-2019, 06:05 PM
If I put "& # 38 ;" and "& amp ;" in the entities to preserve and then use "& # 38 ;" in the text, when I open the file it's replaced with &. (Remove the spaces from the quoted stuff.)
Reply 

#10  DiapDealer 05-19-2019, 06:08 PM
What version of Sigil? What O.S.?
(5.11.2 is the Qt5 version, not a Sigil version number)

I don't have any trouble with the latest Sigil using entities. Perhaps your Sigil.ini file is corrupt. Back it up, delete it (or rename it) and relaunch Sigil so it generates a new one. See if that fixes the issue.

You really shouldn't have an empty Preserve Entities list. The bare minimum is   (for EPUB3) and   (for EPUB2). That's why   is added by default. Bad things can happen if you run without one or the other (though I've never encountered the issues you're describing).

The next versions of Sigil will be able to run without any entries in the Preserve Entities list.
Reply 

  Next »  Last »  (1/3)
Today's Posts | Search this Thread | Login | Register