View Single Post
Old 04-23-2014, 03:20 PM   #648
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by Rev. Bob View Post
None of that code is close to what I've changed; I don't think it's even getting to the new routines. My first instinct is that the OPF file may not be formatted properly, or perhaps the first file in the spine has a similar issue.
I haven't heard anything back on this, and I can't reproduce it on this end.

Meanwhile, I have been reminded to add one more type of "garbage" element to the cleanup list, and it comes in this form:

<?dp n="3" folio="" ?>

(Where N can be any number.)

This seems to be an artifact of some creation software that I haven't encountered directly, but it doesn't appear to serve any purpose in a finished ebook - so out it comes! It's not even as useful as an attribute-less SPAN element, which could at least theoretically be targeted by CSS. Therefore, the strip-spans module now removes anything of this form:

<\?dp([^>]*?)\?>\n?

(Or, for those who don't speak regex, "any single tag delimited by <?dp at one end and ?> at the other, containing anything except the > character in between, along with an optional linefeed at the end." )

The attached versions of the plugin include that fix, and I've updated the help file to remove the "experimental" notes and document the self-closing and empty-removal features. If there are no objections to this version, the only thing I see that's left to do is choose between the one-routine and two-routine options. As before, the file with the longest name is the two-routine version.

Feedback is encouraged, but please let me know which version of the code (one or two routines) you're using.
Attached Files
File Type: zip Modify ePub - stripspans.zip (150.6 KB, 258 views)
File Type: zip Modify ePub - stripspans and stripkobo.zip (150.7 KB, 246 views)
Rev. Bob is offline   Reply With Quote