Quote:
Originally Posted by JSWolf
But for those of us who want to fix the code some, the kepub is a nightmare inside. The original code moght not be the best it could be, but when the ePub gets converted to kepub, it's many many times worse. Even after using Modify ePub, there's still some crud left in.
|
Really? Even before using ModifyEpub, using Sigil, it took a few minutes worth of running canned regular expressions to remove the Kobo location spans and another half minute to delete the .js files. Now if you wanted to modify the files as stored on an Android device which the .zip wrapper is unpacked, that is a bit more of a challenge.
Looking at Locked In, the added code is the location spans wrapped around every sentence:
<span class="koboSpan" id="kobo.6.4" xmlns="http://www.w3.org/1999/xhtml">
and the following at the head of each file:
<!-- kobo-style -->
<script src="../Misc/kobo.js" type="text/javascript" xmlns="http://www.w3.org/1999/xhtml">
</script>
<style type="text/css">
.koboSpan { -webkit-text-combine: inherit; }
</style>
A simple regex to reduce each location span to <span>
something like
find: <<span class="koboSpan" id="kobo(.*?)" xmlns="http://www.w3.org/1999/xhtml">
replace: <span>
and a simple find the header string and replace with nothing.