]> git.openstreetmap.org Git - rails.git/blob - config/initializers/sanitize.rb
Switch to using vips for image processing
[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].remove_class
8     env[:node].kwattr_remove("style", nil)
9     env[:node].add_class("table table-sm w-auto") if env[:node_name] == "table"
10   end
11 )