lib/onebox/preview.rb in onebox-1.7.8 vs lib/onebox/preview.rb in onebox-1.7.9
- old
+ new
@@ -1,8 +1,5 @@
-require "sanitize"
-require_relative "onebox_sanitize_config"
-
module Onebox
class Preview
attr_reader :cache
WEB_EXCEPTIONS ||= [Net::HTTPServerException, OpenURI::HTTPError, Timeout::Error, Net::HTTPError, Errno::ECONNREFUSED]
@@ -62,10 +59,10 @@
html
end
def sanitize(html)
- Sanitize.fragment(html, Sanitize::Config::ONEBOX)
+ Sanitize.fragment(html, @options[:sanitize_config] || Sanitize::Config::ONEBOX)
end
def engine
return nil unless @engine_class
@engine ||= @engine_class.new(@url, cache)