1 Sanitize::Config::OSM = Sanitize::Config.merge(
2 Sanitize::Config::RELAXED,
3 :elements => Sanitize::Config::RELAXED[:elements] - %w[div style],
4 :remove_contents => %w[script style],
5 :transformers => lambda do |env|
6 env[:node].remove_class
7 env[:node].kwattr_remove("style", nil)
8 env[:node].add_class("table table-sm w-auto") if env[:node_name] == "table"
10 if env[:node_name] == "a"
11 rel = env[:node]["rel"] || ""
13 env[:node]["rel"] = rel.split.select { |r| r == "me" }.append("nofollow", "noopener", "noreferrer").sort.join(" ")