Displaying 1 result from an estimated 1 matches for "remove_style_blocks".
2013 Jun 06
0
Using Loofah to gain control of what HTML tags get sanitized
...s://github.com/kaspth/gsoc-application>
:
class Comment < ActiveRecord::Base
# block based
# block takes a node
scrubs :body do |node|
node.remove if node.name == "script"
end
# method based
# method is last argument and has a node parameter
scrubs :name, :body, :remove_style_blocks
# list based via a kind option
# options are based on the available scrubbers in Loofah
scrubs :name, kind: :whitelist end
I really want to hear if this is something you would consider, and if so
where we should define it. I was discussing this a bit with Rafael, and he
said he wasn'...