Look up tidy (libtidy and the python wrapper for it)
It's easy and will make sure that user input is properly escaped.
I use it in the controller method that's called by a form action like this:

import tidy

   .
   .
   .

  def someaction(self,*args,**kw):
      mytext=str(tidy.parseString(str(kw['text']),
                         output_xhtml=1,
                         doctype='omit',
                         show_body_only=1))

     # here you can do with "mytext" whatever you want
     # it's a clean xhtml snippet

Uwe

On Sunday 26 August 2007, iain duncan wrote:
> Wondering if anyone can share what they use to test that an app is
> correctly converting and/or escaping user inputted html. Are there
> auto-test tools out there that are easy to incorporate with TG and will
> throw every kind of bad input at it? I know that I don't know enough
> about xhtml to find all the boundary cases by hand .... ;)
>
> Thanks
> Iain
>
>
> 


-- 
        UC

--
Open Source Solutions 4U, LLC   1618 Kelly St
Phone:  +1 707 568 3056         Santa Rosa, CA 95401
Cell:   +1 650 302 2405         United States
Fax:    +1 707 568 6416

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to