View Single Post
Old 04-05-2023, 07:58 PM   #11
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,622
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by Sarmat89 View Post
You shouldn't just remove every span blindly, as some books use nested span tags to represent straight text within a larger italicized section.
Yes, I agree. You need to spend 10min or so figuring out what the classes are doing, especially when they are nested. You might also be removing blockquotes, centering, right aligned, and lots of other styling.

I have never used a plugin to fix these problems. A few well placed regexes can either remove the code or find&replace the convoluted code with your own simpler classes.

In your example a simple regex would have fixed that
Find... <span class="text_14">(.*?)</span>
Replace... \1

Note: if you have nested <span>'s then the above regex will not work correctly as it will stop at the first <span> not the second.

Then look at what is leftover and figure out what it does and either leave it, replace it or remove it.

Last edited by Karellen; 04-09-2023 at 08:34 PM.
Karellen is offline   Reply With Quote