I have a string that contain data formatted through a WYSIWYG editor. But the generated HTML code is not very well formatted. I would like something as the "the_content()" wordpress function, that delivers a string like this:
Lorem ipsum dolor sit amet, <strong>not properly closed
Another paragraph without p, lorem ipsum dolor m nonummy.
To somethig like this:
<p>Lorem ipsum dolor sit amet, <strong>not properly closed</strong></p>
<p>Another paragraph without p, lorem ipsum dolor m nonummy.</p>
I look up to the wordpress core but without much success (found a force_balance_tags() function, but don't seems to be what I want).
So... do you guys know some php class/library/code snippet that does that?