]> git.openstreetmap.org Git - rails.git/blob - config/initializers/sanitize.rb
Merge pull request #3009 from gravitystorm/svg_icons
[rails.git] / config / initializers / sanitize.rb
1 Sanitize::Config::OSM = Sanitize::Config::RELAXED.dup
2
3 Sanitize::Config::OSM[:elements] -= %w[div style]
4 Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferrer" } }
5 Sanitize::Config::OSM[:remove_contents] = %w[script style]
6 Sanitize::Config::OSM[:transformers] = lambda do |env|
7   env[:node].add_class("table table-sm w-auto") if env[:node_name] == "table"
8 end