Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    displaying "safe" HTML from feeds

    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?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts
    you can try http://php.net/tidy its probably your best bet if you dont want to strip tags

  • #4
    Regular Coder Skyzyx's Avatar
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •