FWIW, the difference in this between Sigil-0.9.18 and Sigil-0.9.991 is that under 0.9.18 the QXmlStream reader automatically decoded the xml escaping (and still does under 0.9.991) but 0.9.18 completely recreates the opf with what we actually found in the zip, and that does the proper url encoding when creating the new opf. Under 0.9.991 we do not create the opf, we instead use it exactly as it is found inside the epub which results in a broken opf since the original opf was in fact broken. All we do then is try properly url encode the hrefs as in the spec, and end of url encoding the bad xml escaped string.
If we truly need to, we can go back to assuming all opfs are broken, get what we can from it and create a valid opf from scratch. That just seems to defeat the whole purpose of loading an epub "as-is".
In any event, it is probably a good idea for users to use Doitsu's wonderful epubcheck plugin immediately after loading a strange epub just to let you know what is broken, so it can be fixed before using Sigil's more advanced features.
|