View Single Post
Old 07-07-2020, 11:56 PM   #60
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,114
Karma: 169815798
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Mister L View Post
I believe I gave ample, precise, detailed and consistent indications throughout this thread, including providing a test file and various code samples of the code before and after the plugin. I am sorry if they were not sufficient but the problem is not always on the side you both seem to be indicating.
Quote:
Originally Posted by DiapDealer View Post
You misunderstood me. I wasn't really asking for human answers to most of those questions. I was asking what kind of spaghetti logic would be required within a plugin to get the plugin to always make the "right" decisions on its own? A human can look at the code and easily (sometimes) see where the new tag should be created. A script has to parse all of the html (and make informed guesses about where it makes sense to put it semantically speaking) to avoid creating malformed or improperly nested tags.
Basically what DiapDealer said in his response is what I ran into. For one epub, it is not an issue. For a mass of epubs with the variances in structure, code and even file locations in the zip container, I could find no way to program a reliable tool. I've mentioned some of the issues I ran into, all of which the plugin you want would either have to handle or fail gracefully. As I said, I found using regex to add title="" to an existing header or adding a new header to each file and then copy/pasting ended up taking less time especially when fixing the code to work with epub #25 broke the fixes I put in to deal with epubs #18 and #22.

Someone else may have had less trouble with the code. Perhaps someone without fond memories of a Fortran arithmetic if.
DNSB is online now   Reply With Quote