Merge pull request #2971 from tomhughes/table

Add bootstrap classes to markdown tables
This commit is contained in:
Andy Allan 2020-11-25 11:55:05 +00:00 committed by GitHub
commit 5368f9f9b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,3 +3,6 @@ Sanitize::Config::OSM = Sanitize::Config::RELAXED.dup
Sanitize::Config::OSM[:elements] -= %w[div style]
Sanitize::Config::OSM[:add_attributes] = { "a" => { "rel" => "nofollow noopener noreferrer" } }
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