On Fri, 2007-01-06 at 23:00 -0400, Krys Wilken wrote:
> Hi there,
> 
> You could parse the input with elementree or beautifulsoup and then filter 
> out 
> all tags except the ones you want.  You could wrap all that logic up in a 
> validator.  This is what i did for my blog.  Not sure if it is the most 
> efficient, but it's a sure bet more maintainable than constructing just the 
> right regular expression, IMHO.

I think what I want to do is generate errors if an illegal tag is used
*or* the html is invalid, allow the legal ones, and convert any
remaining special chars into entities. I'm not sure what the best way to
go about this is though.

Is it easy to get Beautiful Soup or Tidy to just indicate if the html is
invalid or if there any tags other than what you want? I took a peek at
the docs, and it looks pretty involved so thought I'd check first with
someone who's done it! 

Iain



--~--~---------~--~----~------------~-------~--~----~
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