lib/i18n/backend/weeler/html_checker.rb in weeler-1.0.4 vs lib/i18n/backend/weeler/html_checker.rb in weeler-1.1.0
- old
+ new
@@ -6,22 +6,26 @@
#
# The HtmlChecker module requires html-scanner
# was extracted from the original backend.
begin
- require 'action_view/vendor/html-scanner'
+ # require 'sanitize'
+ require 'action_controller/base'
rescue LoadError => e
puts "can't use Html because: #{e.message}"
end
module I18n
module Backend
class Weeler
+
module HtmlChecker
+
+ # include ActionView::Helpers::SanitizeHelper
def html?
if html_safe_translation_key?(self.key) ||
- (self.value.present? && HTML::FullSanitizer.new.sanitize(self.value.to_s).length != self.value.to_s.length)
+ (self.value.present? && ActionController::Base.helpers.sanitize(self.value.to_s, {tags: []}).length != self.value.to_s.length)
return true
else
return false
end
end