diff --git a/config/application.rb b/config/application.rb index 0da906e..332a598 100644 --- a/config/application.rb +++ b/config/application.rb @@ -20,7 +20,7 @@ module Noosfero require 'noosfero/plugin' # Adds custom attributes to the Set of allowed html attributes for the #sanitize helper - config.action_view.sanitized_allowed_attributes = 'align', 'border', 'alt', 'vspace', 'hspace', 'width', 'heigth', 'value', 'type', 'data', 'style', 'target', 'codebase', 'archive', 'classid', 'code', 'flashvars', 'scrolling', 'frameborder', 'controls', 'autoplay' + config.action_view.sanitized_allowed_attributes = 'align', 'border', 'alt', 'vspace', 'hspace', 'width', 'heigth', 'value', 'type', 'data', 'style', 'target', 'codebase', 'archive', 'classid', 'code', 'flashvars', 'scrolling', 'frameborder', 'controls', 'autoplay', 'colspan', 'rowspan' # Adds custom tags to the Set of allowed html tags for the #sanitize helper config.action_view.sanitized_allowed_tags = 'object', 'embed', 'param', 'table', 'tr', 'th', 'td', 'applet', 'comment', 'iframe', 'audio', 'video', 'source' diff --git a/test/unit/tiny_mce_article_test.rb b/test/unit/tiny_mce_article_test.rb index b7ba9a4..ee3ace4 100644 --- a/test/unit/tiny_mce_article_test.rb +++ b/test/unit/tiny_mce_article_test.rb @@ -8,7 +8,7 @@ class TinyMceArticleTest < ActiveSupport::TestCase @profile = create_user('zezinho').person end attr_reader :profile - + # this test can be removed when we get real tests for TinyMceArticle should 'be an article' do assert_subclass TextArticle, TinyMceArticle @@ -210,7 +210,7 @@ end assert_equal true, a.notifiable? assert_equal true, a.advertise? assert_equal true, a.is_trackable? - + a.published=false assert_equal false, a.published? assert_equal false, a.is_trackable? @@ -237,4 +237,13 @@ end assert_tag_in_string article.body, :tag => 'source', :attributes => {:src => 'http://example.ogv', :type => 'video/ogg'} end + should 'not sanitize colspan and rowspan attributes' do + article = TinyMceArticle.create!(:name => 'table with colspan and rowspan', + :body => "
", + :profile => profile + ) + assert_tag_in_string article.body, :tag => 'table', + :attributes => { :colspan => 2, :rowspan => 3 } + end + end -- libgit2 0.21.2