Going to give the 2 routine version a try.
I personally think that's the one to finalise, as some user may want to keep the kobo stuff, but strip the empty spans.
With regard to the '<\?dp([^>]*?)\?>\n?' - should you include the \n? - as there may be instances where that \n could be between two words, which in the html would then render as a space, so removing it would be wrong. Unless you can guarantee that it's removable in which case never mind.
|