View Single Post
Old 01-13-2020, 11:44 AM   #15
KevinH
Wizard
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: 4,161
Karma: 2620702
Join Date: Nov 2009
Device: many
Just so that I understand ... If a link is broken, you want to import it as is?

Why? If it does not point to anything before import, why on earth would it point to anything after we import into a new epub?

Are people trying to "pre-edit" the links in an html document before importing it? If so, how would they know the actual structure in the epub unless they assume it will always be in standard format?

If so, wouldn't it be better just to fix the original links so that they point where they should?

Right now, any link will be updated if we move the original file (which is what AddExisting an html file really is doing). At the time of the move, we can not check if an image or stylesheet will actually exist in the final location or not. In the past in a fixed layout, the link to any resource from an xhtml file never depended on the position of the xhtml file or resource due to the fixed layout.

For example: A link from any html to any stylesheet could always be written as ../Styles/sheet.css. A link from any html file to any image could always be written as ../Images/image.png, etc.

Now (since Sigil 1.0) that is no longer the case and can not be assumed. So there are no position of html independent links to resources anymore and leaving them un-updated by the move of the html file simply does not make sense.

So the only way around this is to somehow check if a link exists or not before updating it and that would be hard to do. The universal update code now assumes that every existing link is correct. In the past when we moved all files at the same time together we had a prebuilt list of all links sources and destinations and it no longer does that.

So if this is really important, we will have to figure out if a link is correct on the fly during the move and therefore that the order of the links updates would then matter (ie. can't check if it exists in a future place, only in the past location, etc).

If this is so that people can "pre-edit links" in an html file before adding it, I really do not think it is worth the trouble.

KevinH

Last edited by KevinH; 01-13-2020 at 12:01 PM.
KevinH is online now   Reply With Quote