]> git.openstreetmap.org Git - rails.git/blob - config/initializers/sanitize.rb
Rework configuration to use Sanitize::Config.merge
[rails.git] / config / initializers / sanitize.rb
1 Sanitize::Config::OSM = Sanitize::Config.merge(
2   Sanitize::Config::RELAXED,
3   :elements => Sanitize::Config::RELAXED[:elements] - %w[div style],
4   :add_attributes => { "a" => { "rel" => "nofollow noopener noreferrer" } },
5   :remove_contents => %w[script style],
6   :transformers => lambda do |env|
7     env[:node].add_class("table table-sm w-auto") if env[:node_name] == "table"
8   end
9 )