Strip away class attributes from sanitized outputs
There's a lot of shenanigans that are possible when you can apply arbitrary classes to the rendered output.
This commit is contained in:
parent
f442bb9e80
commit
d7eac9b5a8
2 changed files with 14 additions and 0 deletions
|
@ -4,6 +4,7 @@ Sanitize::Config::OSM = Sanitize::Config.merge(
|
|||
:add_attributes => { "a" => { "rel" => "nofollow noopener noreferrer" } },
|
||||
:remove_contents => %w[script style],
|
||||
:transformers => lambda do |env|
|
||||
env[:node].remove_class
|
||||
env[:node].add_class("table table-sm w-auto") if env[:node_name] == "table"
|
||||
end
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue