[Git][noosfero/noosfero][master] 2 commits: CommentParagraph: add data-macro-paragraph_uuid in sanitized allowed attributes
Leandro Nunes
gitlab at mg.gitlab.com
Tue May 10 14:10:04 BRT 2016
Leandro Nunes pushed to branch master at Noosfero / noosfero
Commits:
f85258d0 by Leandro Nunes dos Santos at 2016-05-10T13:53:34-03:00
CommentParagraph: add data-macro-paragraph_uuid in sanitized allowed attributes
- - - - -
d05d2562 by Leandro Nunes at 2016-05-10T17:09:48+00:00
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
- - - - -
2 changed files:
- plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb
- plugins/comment_paragraph/test/unit/article_test.rb
Changes:
=====================================
plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb
=====================================
--- 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
=====================================
plugins/comment_paragraph/test/unit/article_test.rb
=====================================
--- 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
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/930a5a0226a6eb9100dab2d907586ac33cdc5b5b...d05d2562e85daa66f1dc3be52972e89f61545a9b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160510/82355c49/attachment-0001.html>
More information about the Noosfero-dev
mailing list