I'm looking for tips on how to clear the submitted HTML in a web application so that it can be re-rendered in the future using styles or unclosed tags that destroy the layout of the application.
In my application, rich HTML is represented by users with the YUI Rich text editor, which by default runs several regular expressions to clear input, and I also call [ filter_MSWord][1] to catch any shit sent from the office
At the back end, I run ruby-tidy to disinfect html before displaying it as comments, but sometimes the poorly inserted html still affects the layout of the application I use - how can I protect against this?
FWIW here are the sanitizer settings that I use -
module HTMLSanitizer def tidy_html(input) cleaned_html = Tidy.open(:show_warnings=>false) do |tidy|
What else are my options here?
source share