Add bootstrap classes to markdown tables

This commit is contained in:
Tom Hughes 2020-11-19 10:17:21 +00:00
parent 4e78f3ae5b
commit d516ba5335

View file

@ -3,3 +3,6 @@ Sanitize::Config::OSM = Sanitize::Config::RELAXED.dup
Sanitize::Config::OSM[:elements] -= %w[div style] Sanitize::Config::OSM[:elements] -= %w[div style]
Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferrer" } } Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferrer" } }
Sanitize::Config::OSM[:remove_contents] = %w[script style] Sanitize::Config::OSM[:remove_contents] = %w[script style]
Sanitize::Config::OSM[:transformers] = lambda do |env|
env[:node].add_class("table table-sm w-auto") if env[:node_name] == "table"
end