blob: 183908d02a9a30a1a4d5c3f9d67ddabfdd2d9285 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# frozen_string_literal: true
module Banzai
module Filter
# Sanitize HTML produced by Markdown. Allows styling of links and usage of line breaks.
#
# Extends Banzai::Filter::BaseSanitizationFilter with specific rules.
class BroadcastMessageSanitizationFilter < Banzai::Filter::BaseSanitizationFilter
def customize_allowlist(allowlist)
allowlist[:elements].push('br')
allowlist[:attributes]['a'].push('class', 'style')
allowlist[:css] = { properties: %w(color border background padding margin text-decoration) }
allowlist
end
end
end
end
|