Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-07-2025, 03:25 PM   #1
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Commented lines are removed

Hello--

After commenting an html line, the page seems to automatically re-code and then I lose that line. Is there any way to recover it? Is it just hidden?

Similar question: If a text or image file is loaded into the book browser, but that file is not found in the spine, those files are either removed or hidden from the book browser after Sigil restart. Is there any way to recover those? Are they hidden somewhere?

Thanks,
Steve
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 03:39 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
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.
KevinH is offline   Reply With Quote
Advert
Old 07-07-2025, 04:27 PM   #3
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Hi Kevin, thanks for responding.

The line removal happened after I commented a line in the spine, so I wonder if that triggers a sort of clean up command. I hadn't run the mend or prettify commands yet.

So what you're saying is that I shouldn't use the comment feature if I expect the code to keep the line (after a clean)! I found the auto mend on close and save in the preferences.

As far as the image thing, I didn't word the question the right way. I'll send a couple of screen shots of what I mean:

1) the html file called for in the spine has the idref of "cover ..."
2) the image called in "cover ..." is d2d_images/cover.jpg"
3) d2d_images/cover.jpg doesn't exist in the virtual image folder in Book Browser

Thanks for taking a look!

Last edited by KevinH; 07-07-2025 at 04:47 PM.
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 04:32 PM   #4
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
I don't see it. Is there a way to delete the post? I'll post a much smaller image ...
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 04:47 PM   #5
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Hi Kevin--

Sorry for the monster post due to the large image. I fixed it, but am no longer able to edit the post (I sent a message to the webmaster that I can fix it).

Here is the repaired post contents:

Hi Kevin, thanks for responding.

The line removal happened after I commented a line in the spine, so I wonder if that triggers a sort of clean up command. I hadn't run the mend or prettify commands yet.

So what you're saying is that I shouldn't use the comment feature if I expect the code to keep the line (after a clean)! I found the auto mend on close and save in the preferences.

As far as the image thing, I didn't word the question the right way. I'll send a couple of screen shots of what I mean:

1) the html file called for in the spine has the idref of "cover ..."
2) the image called in "cover ..." is d2d_images/cover.jpg"
3) d2d_images/cover.jpg doesn't exist in the virtual image folder in Book Browser

Thanks for taking a look.

Last edited by KevinH; 07-07-2025 at 05:00 PM.
solidwalnut is offline   Reply With Quote
Advert
Old 07-07-2025, 04:50 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
I edited your post and removed the huge inline image. Simply attach individual images to your post, do not inline them.

For what it is worth, ... go to Sigil Preferences and turn on BookBrowser showing full paths instead of short names, that way we should be able to see more info.

And yes from your previous issue no file existed in the Images folder in BookBrowser with that name. Was that particular file ever part of the epub? Could you have left it out by mistake?

One thing to try is to save the epub to a *new* file name, then unzip the resulting .epub file and manually inspect the resulting unpacked epub to see if that file really exists someplace.

But in general, directly editing the opf spine is probably not the best idea. The Text folder in BookBrowser depends on it and shows you the files in spine order and allows you to drag and drop to change that order.

Only directly edit the OPF is you are absolutely sure you know what you are doing. And understand that commenting something out in the OPF is just the same as deleting it, since the OPF deletes all comments.

Last edited by KevinH; 07-07-2025 at 05:09 PM.
KevinH is offline   Reply With Quote
Old 07-07-2025, 04:53 PM   #7
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Thanks for taking a look!

I'll go back and look for showing full path in preferences ...

Last edited by KevinH; 07-07-2025 at 05:00 PM.
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 05:01 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
Please use the Attachments command in your MR post for all images, and do not inline large images. Instead attach them using the MR interface to do that.
KevinH is offline   Reply With Quote
Old 07-07-2025, 05:03 PM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by KevinH View Post
Please use the Attachments command in your MR post for all images, and do not inline large images. Instead attach them using the MR interface to do that.
He might not be able to attach images just yet. I'm not sure how many posts have to be made before you are allowed to attach images.
JSWolf is offline   Reply With Quote
Old 07-07-2025, 05:09 PM   #10
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Ok. Thanks for all this info. Yes, Book Browser is currently showing the full path. Yes, I have edited opf and others manually, and yes, the image did exist before other edits. I'm new to the software and learning. I'll eventually learn that I need to code content but let mend and prettify do their jobs. Thanks!
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 05:11 PM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by JSWolf View Post
He might not be able to attach images just yet. I'm not sure how many posts have to be made before you are allowed to attach images.
Good point! Can a moderator change that for him, or is it just number of posts that matter.
KevinH is offline   Reply With Quote
Old 07-07-2025, 05:11 PM   #12
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Quote:
Originally Posted by KevinH View Post
I edited your post and removed the huge inline image. Simply attach individual images to your post, do not inline them.

For what it is worth, ... go to Sigil Preferences and turn on BookBrowser showing full paths instead of short names, that way we should be able to see more info.

And yes from your previous issue no file existed in the Images folder in BookBrowser with that name. Was that particular file ever part of the epub? Could you have left it out by mistake?

One thing to try is to save the epub to a *new* file name, then unzip the resulting .epub file and manually inspect the resulting unpacked epub to see if that file really exists someplace.

But in general, directly editing the opf spine is probably not the best idea. The Text folder in BookBrowser depends on it and shows you the files in spine order and allows you to drag and drop to change that order.

Only directly edit the OPF is you are absolutely sure you know what you are doing. And understand that commenting something out in the OPF is just the same as deleting it, since the OPF deletes all comments.
Thanks Kevin. I'll learn that I need to modify the content but let Mend and Prettify do their jobs on the other files.
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 05:12 PM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
Does the cover image show up as missing in Preview? You might want to go back and reload the MR page and re-read my answer to your initial query. I have expanded it as I think you are mixing adding xml comments to the opf, with adding xhtml comments. Mend only impacts the xhtml files not the OPF. No comments are allowed or saved in the OPF, so commenting out in the spine of the OPF is the same as deleting it.

I just tried what you did on my machine by commenting out the cover (the first entry in the spine), and it was promptly removed from the spine. But the Cover.xhtml file still exists in BookBrowser and the cover image still existed in Images.

So I can not recreate what you are seeing and I have no idea how that image got deleted in your epub as mine was still used and linked after doing the exact same thing. You must have taken or used additional commands, but without those I cannot recreate things to help.

Last edited by KevinH; 07-07-2025 at 05:22 PM.
KevinH is offline   Reply With Quote
Old 07-07-2025, 05:13 PM   #14
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
Quote:
Originally Posted by KevinH View Post
Does the cover image show up as missing in Preview?
No, it shows.
solidwalnut is offline   Reply With Quote
Old 07-07-2025, 05:15 PM   #15
solidwalnut
Member
solidwalnut began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jul 2025
Device: Kindle Previewer and Chrome
All I see is the pix icon, which apparently is only allowing inline using the img tags.
solidwalnut is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB to PDF: hyperlinks that span lines make all of both lines clickable metallserge Conversion 4 09-23-2021 06:39 AM
Dashed lines auto removed if output type is mobi flyingfoxlee Recipes 3 05-20-2013 09:08 AM
Ended removed smallhagrid Flea Market 4 08-06-2012 05:20 PM
Touch Dark lines between lines of text taming Kobo Reader 12 06-13-2011 07:20 PM
Anyone know of where there is commented Shakespeare? Bob Russell Workshop 1 04-05-2007 12:51 AM


All times are GMT -4. The time now is 11:17 PM.


MobileRead.com is a privately owned, operated and funded community.