Sigil-Ebook / Sigil

Sigil is a multi-platform EPUB ebook editor
GNU General Public License v3.0
5.96k stars 578 forks source link

[Bug]: Messes up HTML code #713

Closed LinAGKar closed 1 year ago

LinAGKar commented 1 year ago

Bug Description

It seems like Sigil sometimes to secretly mess up the HTML code in various ways. For example, it removes the indentation from the and tags (but not and ), removes trailing line feeds, and replaces HTML character escapes with unicode characters (even if they then end up being invisible!). If you go through the book and corrects it, Sigil will then eventally mess it up again. But not immediately, there seems to be some kind of waiting period which lulls you into a false sense of security.

Platform (OS)

Linux

OS Version / Specifics

OpenSUSE Tumbleweed

What version of Sigil are you using?

1.9.30

Any backtraces or crash reports

No response

dougmassay commented 1 year ago

This is all by design.

Indentation is irrelevant in HTML (unless it's inside of pre tags which Sigil will honor). Same with line feeds. As for entities, look in the user guide for how to "Preserve Entities".

dougmassay commented 1 year ago

In short... not a bug. Expected behavior.

LinAGKar commented 1 year ago

Even if you can disable it for certain entities though, well, firstly you have to realize Sigil is going behind your back and doing this, and then you need to list all the characters that need to be preserved. Certainly violates the The Principle of Least Surprise. And because it is done by default, it means the book ends up tainted if you ever open it in an unconfigured Sigil to make a minor change.

As for the indentation, yes, they don't show up in the rendered document, but it does mean the source code formatting ends up looking strange because you're trying to force your weird indentation on people.

Sorry if I'm coming off strong here, but it does feel pretty annoying when it feels like the application is working against me.

dougmassay commented 1 year ago

Sounds like you need to decide if Sigil is for you or not.

Come off as strong as you like, but the fact of the matter is that this is not a bug. It's just something you don't like. The Sigil Issue database is for reporting actual bugs. Not for reporting things you wish were different, nor for the reporting of principle violations.