mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
14 lines
406 B
Ruby
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
|