Files
openfoodnetwork/app/services/trix_scrubber.rb
2023-09-04 15:46:54 +02:00

14 lines
406 B
Ruby

# frozen_string_literal: true
class TrixScrubber < Rails::Html::PermitScrubber
ALLOWED_TAGS = ["p", "b", "strong", "em", "i", "a", "u", "br", "del", "h1", "blockquote", "pre",
"ul", "ol", "li", "div", "hr"].freeze
ALLOWED_ATTRIBUTES = ["href", "target", "src", "alt"].freeze
def initialize
super
self.tags = ALLOWED_TAGS
self.attributes = ALLOWED_ATTRIBUTES
end
end