diff --git a/html_terminator.gemspec b/html_terminator.gemspec index 44cfc95..b362c5c 100644 --- a/html_terminator.gemspec +++ b/html_terminator.gemspec @@ -21,5 +21,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" - spec.add_runtime_dependency "sanitize" + spec.add_runtime_dependency "sanitize", "~> 4.0" end diff --git a/lib/html_terminator.rb b/lib/html_terminator.rb index 9dcf094..d6073e6 100644 --- a/lib/html_terminator.rb +++ b/lib/html_terminator.rb @@ -8,7 +8,7 @@ module HtmlTerminator def self.sanitize(val) if val.is_a?(String) && !skip_sanitize?(val) - Sanitize.clean(val, SANITIZE_OPTIONS).strip.gsub(/&/, "&") + Sanitize.fragment(val, SANITIZE_OPTIONS).strip.gsub(/&/, "&") else val end