Commit d05d2562e85daa66f1dc3be52972e89f61545a9b

Authored by Leandro Santos
2 parents 930a5a02 f85258d0

Merge branch 'fix_comment_paragraph_parse' into 'master'

CommentParagraph: add data-macro-paragraph_uuid in sanitized allowed attributes

After save TinyMceArticle article a worng parse was removing  data-macro-paragraph_uuid from body data

See merge request !912
plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb
1 -# FIXME See a better way to generalize this parameter.  
2 -Loofah::HTML5::WhiteList::ALLOWED_ATTRIBUTES.merge %w[data-macro data-macro-group_id] 1 +class Application < Rails::Application
  2 + config.action_view.sanitized_allowed_attributes << 'data-macro-paragraph_uuid'
  3 +end
3 4
4 class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro 5 class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro
5 6
plugins/comment_paragraph/test/unit/article_test.rb
@@ -5,7 +5,7 @@ class ArticleTest &lt; ActiveSupport::TestCase @@ -5,7 +5,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
5 5
6 def setup 6 def setup
7 @profile = fast_create(Community) 7 @profile = fast_create(Community)
8 - @article = fast_create(TextArticle, :profile_id => profile.id) 8 + @article = fast_create(TinyMceArticle, :profile_id => profile.id)
9 @environment = Environment.default 9 @environment = Environment.default
10 @environment.enable_plugin(CommentParagraphPlugin) 10 @environment.enable_plugin(CommentParagraphPlugin)
11 end 11 end