From d93342e1d7122492b39378f16f2a36146f906aba Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 11 May 2021 14:44:18 +0200 Subject: [PATCH] config: cleanup allowed tags after Rails 6.1 migration --- config/application.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config/application.rb b/config/application.rb index 62cc0206e..f5ab729ae 100644 --- a/config/application.rb +++ b/config/application.rb @@ -38,12 +38,7 @@ module TPS config.assets.paths << Rails.root.join('app', 'assets', 'fonts') config.assets.precompile += ['.woff'] - # The default list used to be accessible through `ActionView::Base.sanitized_allowed_tags`, - # but a regression in Rails 6.0 makes it unavailable. - # It should be fixed in Rails 6.1. - # See https://github.com/rails/rails/issues/39586 - # default_allowed_tags = ActionView::Base.sanitized_allowed_tags - default_allowed_tags = ['strong', 'em', 'b', 'i', 'p', 'code', 'pre', 'tt', 'samp', 'kbd', 'var', 'sub', 'sup', 'dfn', 'cite', 'big', 'small', 'address', 'hr', 'br', 'div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'abbr', 'acronym', 'a', 'img', 'blockquote', 'del', 'ins'] + default_allowed_tags = ActionView::Base.sanitized_allowed_tags config.action_view.sanitized_allowed_tags = default_allowed_tags + ['u'] # Some mobile browsers have a behaviour where, although they will delete the session