From f85258d09f6293ee4257e339fc3517a5e705bf44 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Tue, 10 May 2016 13:53:34 -0300 Subject: [PATCH] CommentParagraph: add data-macro-paragraph_uuid in sanitized allowed attributes --- plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb | 5 +++-- plugins/comment_paragraph/test/unit/article_test.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb b/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb index 8713402..1414591 100644 --- a/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb +++ b/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb @@ -1,5 +1,6 @@ -# FIXME See a better way to generalize this parameter. -Loofah::HTML5::WhiteList::ALLOWED_ATTRIBUTES.merge %w[data-macro data-macro-group_id] +class Application < Rails::Application + config.action_view.sanitized_allowed_attributes << 'data-macro-paragraph_uuid' +end class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro diff --git a/plugins/comment_paragraph/test/unit/article_test.rb b/plugins/comment_paragraph/test/unit/article_test.rb index ae4359d..045b7ba 100644 --- a/plugins/comment_paragraph/test/unit/article_test.rb +++ b/plugins/comment_paragraph/test/unit/article_test.rb @@ -5,7 +5,7 @@ class ArticleTest < ActiveSupport::TestCase def setup @profile = fast_create(Community) - @article = fast_create(TextArticle, :profile_id => profile.id) + @article = fast_create(TinyMceArticle, :profile_id => profile.id) @environment = Environment.default @environment.enable_plugin(CommentParagraphPlugin) end -- libgit2 0.21.2