Rick O. wrote:
I’m seeing the need for that actually. I’m not sure it’s anything I’d
have to add support for in my plugin though, I’ll probably just make
helpers like white_list_comments that pass in special customizations.
Here it is.
Keep in mind I just picked up Ruby and Rails mid-August, so forgive me
if you see me baby-talking in my code. Just think “aww… that’s so
cute! He’s learning to talk like big people do!”
You can test it out interactively with the default profile at
http://www.kookdujour.com/filter_test . I’ve attempted to make the Rdoc
as clear as possible, but generally I’m pretty happy with the
flexibility this helper provides in terms of making output “safe”.
The way I’ll use it is to define different “tag profiles” as constants
in my models, then pass those tag profiles to “unsafe” HTML right before
display. Because the profile is a data structure, one could build a more
interactive way of defining what tags/attributes are allowed to who.
Feedback is GREATLY appreciated.