aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-10-03 17:02:54 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-10-03 17:02:54 -0700
commit3b6b70f0bcbf230e40ba8078c135eb68b6c3faa4 (patch)
treec47f2514082d68a2939f516c3040af1049d76df0
parent304e91765d89e4f8d190f3dbb80ad9ee277be95d (diff)
downloadrails-3b6b70f0bcbf230e40ba8078c135eb68b6c3faa4.tar.gz
rails-3b6b70f0bcbf230e40ba8078c135eb68b6c3faa4.tar.bz2
rails-3b6b70f0bcbf230e40ba8078c135eb68b6c3faa4.zip
Declare prior to use
-rw-r--r--app/helpers/action_text/content_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/action_text/content_helper.rb b/app/helpers/action_text/content_helper.rb
index d6ced93502..aa2aeba44b 100644
--- a/app/helpers/action_text/content_helper.rb
+++ b/app/helpers/action_text/content_helper.rb
@@ -1,4 +1,8 @@
module ActionText
+ SANITIZER = Rails::Html::Sanitizer.white_list_sanitizer
+ ALLOWED_TAGS = SANITIZER.allowed_tags + [ ActionText::Attachment::TAG_NAME, "figure", "figcaption" ]
+ ALLOWED_ATTRIBUTES = SANITIZER.allowed_attributes + ActionText::Attachment::ATTRIBUTES
+
module ContentHelper
def render_action_text_content(content)
content = content.render_attachments do |attachment|
@@ -21,8 +25,4 @@ module ActionText
sanitize content.to_html, tags: ActionText::ALLOWED_TAGS, attributes: ActionText::ALLOWED_ATTRIBUTES
end
end
-
- SANITIZER = Rails::Html::Sanitizer.white_list_sanitizer
- ALLOWED_TAGS = SANITIZER.allowed_tags + [ ActionText::Attachment::TAG_NAME, "figure", "figcaption" ]
- ALLOWED_ATTRIBUTES = SANITIZER.allowed_attributes + ActionText::Attachment::ATTRIBUTES
end