this one is tricky. I am doing a lot DOM manipulation with js and jquery. After some time i get a lot of these
Great blog
<span style="font-weight: bold;">
post
<span style="font-weight: bold;">
from the Ba
</span>
ltimo
</span>
team
Think anyone can come up with a function that starts at the body, and traverses the entire DOM and cleans this kind of stuff up? Its ok if it takes a while.
the above code should be cleaned to this
<span style="font-weight:bold">Great Blog Post from the Baltimore team</span>
of course you have to worry about not combing elements if they don't have the same style, and you can't just compare siblings, because sometimes children need to combined up to their parents.
so 2 sub functions to make this happen would be like
combineParentWithChild
and then CombineSiblings
i think.
thanks!