DEV: Don’t patch Sanitize::Config

Currently we’re reopening the `Sanitize::Config` class (which is part of
the `sanitize` gem) to put our custom config for Onebox in it. This is
unnecessary as we can simply create a dedicated module to hold our
custom configuration.
This commit is contained in:
Loïc Guitaut
2022-04-06 15:19:41 +02:00
committed by Loïc Guitaut
parent 1203121ac1
commit 46176b7dd7
5 changed files with 22 additions and 30 deletions

View File

@ -81,7 +81,7 @@ module Onebox
end
def sanitize(html)
config = @options[:sanitize_config] || Sanitize::Config::ONEBOX
config = @options[:sanitize_config] || SanitizeConfig::ONEBOX
config = config.merge(allowed_iframe_regexes: @options[:allowed_iframe_regexes])
Sanitize.fragment(html, config)