Thread: Quick Question
View Single Post
Old 10-31-2020, 12:47 PM   #24
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,115
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DiapDealer View Post
That may be the difference. I never bother trying to manually untangle an unruly div nest (even though 'Prettify' makes divs fairly easy for me to navigate) these days. So I'm never really looking for a particular closing tag in the first place. If the markup in question can't be safely/quickly regexed, then I turn to a parsing tool to safely match and delete/change tag pairs. Knowing where the closing tag is ahead of time provides no benefit in my editing process. *shrug*
Baen has one of the messiest (unnecessary) Div nests I have seen. Whatever Slit method they use, I generates a additional Nested Div per Chapter (file)

This is my BaenDeDiv search (I adjust the calibre# as it varies
Code:
Find="(?sm)<div class=\"calibre4\" id=\"calibre_pb_\\d+\">\\s+<p (.+)</p>\\s+(<div class=\"calibre6\" id=\"calibre_pb_\\d+\"></div>\\s+)*</div>"
99\Replace=<p \\1 </p>
By the last chapter, it can be 30+ levels (I repeat this Replace All many times until Not Found status appears)
theducks is offline   Reply With Quote