Hi,

I recommend using an html sanitizer lib instead.
A lot of libs allow you to specify what tags are valid, and they also
scan for XSS and that kind of crap :)

Example of lib :
https://launchpad.net/python-html-sanitizer

Jonathan

On 6 oct, 07:14, Adrian von Bidder <[email protected]> wrote:
> Heyho!
>
> Just coding up a very simple Forum/Blog system as tg2 exercise (I plan to
> releasee the code once it's reached some basic usable form.)
>
> I want to allow HTML content.  I'm sure there already is code for allowing
> restricted HTML subset - pointers very welcome.
>
> I plan to allow just <p>, <b>, <a href=""> (with safe links...), <i>.
> Perhaps <blockquote>.
>
> Of course I can just iterate through an ElementTree, but since this
> certainly has already been done, some kind of warpper for this would be
> neat.  Bonus points for having a fault tolerant parser that just reformats
> input to correct html (perhaps even disallow nested <p> and close <p>'s
> instead of complaining when users nest them?)
>
> cheers
> -- vbi
>
> --
> Nichts ist so sehr für die gute alte Zeit verantwortlich wie das
> schlechte Gedächtnis.
>                 -- Anatole France
>
>  signature.asc
> < 1 000AfficherTélécharger
--~--~---------~--~----~------------~-------~--~----~
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