Xhtml comments are left alone. Only comments made *before* the document root node are removed when you tell it to mend or prettify the html, or run a command that requires parsing all html (such as renaming a file, etc) and the comment is above the document node. Both will collect and remove any html comments above the document node as extraneous material. You may have enabled mend on open or close as well.
This follows the rules of parsing an html file to build a dom and serializing it, which is how links, urls, and etc are updated when a rename is done. So if you want an html comment to exist in the final epub for some strange reason then add it somewhere *after* the document node (inside the body is safest although they can exist in head) or add it anyplace but *after* all major file naming and structural changes have been done, and remember to turn off Mend on Save before the final save of the epub is done if the comment is not inside the body tag.
If you are referring to xml comments in the OPF, then yes they are all removed, and will be the first time the OPF is parsed to run a Sigil command. Sigil works by machine parsing the OPF and keeping it in parsed form and rebuilding it on demand. No comments are kept in the OPF and none will be. The OPF inside Sigil and in its plugins is meant to be kept in machine parseable form at all times (where comments are not meaningful). It does this for speed reasons primarily, but since the OPF is never seen by an e-reader, a comment inside the OPF is truly worthless once published.
Image files *cannot* be part of the spine directly. Only xhtml files are supported in the spine by Sigil and most e-readers. They of course can contain a single svg or image and fill the screen just like a cover image in a cover.xhtml file does, so fancy scalable comics are still possible.
The problem is many e-readers barf horribly when an image or .svg file is added directly to the spine, which is why Sigil purposely limits you to xhtml files but which can inline svg, and link images, and xhtml can use the object tag to handle any required resource type fallback while providing for alt text for accessibility, aria roles, etc that an image alone can not support.
Images are not removed unless they were never added to the opf manifest somehow. Since Sigil's Add Existing ... file handles that, I am not sure how that could happen.
Did you look for your image in the Images virtual folder in BookBrowser?
If you can post a sample epub with a missing Image, I would be happy to take a look.
Last edited by KevinH; 07-07-2025 at 04:28 PM.
|