You asked for it...
Now that I've had a chance to pick up davidfor's mods and address the bugs, here's a new version. This should properly handle Unicode and nested empty elements, as well as fixing the bugs. (Most pernicious bug: <div>blah<div class="x"/></div> would become <div>blah<div class="x"//> instead of properly remaining untouched!)
Stripspans also has a new tweak: it de-indents the <head> element and all the usual elements inside it, as well as the <body> element (but not its contents). That's purely a stylistic preference on my part, and I should note that it does not de-indent the contents of <style> elements - just the <style> and </style> lines themselves. Stripspans also keeps going over each document until it comes back unchanged, so there can be any number of contentless elements nested inside each other, and stripspans will catch them all. I tested this with a big string of nested bold and italic elements, at least a dozen levels deep, and stripspans removed 'em all.
I've said it before, but hopefully this will be the last time: I've attached the latest version, I think I've got the bugs worked out, and if nobody else can find one - let's say, by July 31, just before I have surgery - then I'll hand it off to kiwidude on August 1. That's about two weeks for testing; feedback and beta reports are greatly appreciated.
And yes, although the filename says "for qt5", it's also good for earlier versions.
|