View Full Version : displaying "safe" HTML from feeds

03-06-2008, 05:34 PM
I have feed content I serve in my site

Sometimes the HTML in the feed content is bad and leaves an open container element which screws up the HTML formatting on the page.

I know I can strip some HTML tags with PHP.. but I need the HTML tags in the feed content in order to retaining some formatting. Otherwise the feed content looks "boring" and flat.

But there has to be some give and take here... it's a tradeoff.. crap HTML or boring content.

Other than stripping all the container tags from the feeds, are there any other solutions I can consider to "tame" the RSS content?

03-06-2008, 05:44 PM
Strip the tags from the content and parse the RSS content and put them into your own HTML elements that you create using your php.

03-07-2008, 06:50 AM
you can try http://php.net/tidy its probably your best bet if you dont want to strip tags

03-13-2008, 04:51 AM
Bobafart -- Are you the developer of Gabbr.com? I think my worlds are crossing. :)

If you go digging into the WordPress code, I know that they have an HTML "balancer" that will ensure that everything opened gets closed in the end. I believe the function is called balance_tags(). You might even be able to Google for it.