Files
grecia/lib/wysiwyg_sanitizer.rb
2019-09-10 20:02:15 +02:00

15 lines
269 B
Ruby

class WYSIWYGSanitizer
def allowed_tags
%w[p ul ol li strong em u s a h2 h3]
end
def allowed_attributes
%w[href]
end
def sanitize(html)
ActionController::Base.helpers.sanitize(html, tags: allowed_tags, attributes: allowed_attributes)
end
end