Class: Redmine::WikiFormatting::CommonMark::SanitizationFilter

Inherits:
HTML::Pipeline::SanitizationFilter
  • Object
show all
Includes:
Helpers::URL
Defined in:
lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb

Overview

sanitizes rendered HTML using the Sanitize gem

Constant Summary collapse

RELAXED_PROTOCOL_ATTRS =
{
  "a" => %w(href).freeze,
}.freeze
ALLOWED_CSS_PROPERTIES =
%w[
  color background-color
  width min-width max-width
  height min-height max-height
  padding padding-left padding-right padding-top padding-bottom
  margin margin-left margin-right margin-top margin-bottom
  border border-left border-right border-top border-bottom border-radius border-style border-collapse border-spacing
  font font-style font-variant font-weight font-stretch font-size line-height font-family
  text-align
  float
].freeze

Instance Method Summary collapse

Methods included from Helpers::URL

#uri_with_link_safe_scheme?, #uri_with_safe_scheme?

Instance Method Details

#allowlistObject



42
43
44
# File 'lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb', line 42

def allowlist
  @allowlist ||= customize_allowlist(super.deep_dup)
end