]> source.dussan.org Git - redmine.git/commitdiff
Fixed: notextile tag has no effect.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Jun 2008 20:31:36 +0000 (20:31 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 Jun 2008 20:31:36 +0000 (20:31 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1517 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redcloth.rb
test/unit/helpers/application_helper_test.rb

index 3880eb9d3d8adce5b093156c373e3e964f7d5352..42eddd8e04f5d8fd07d32a9d8a500b3999969bf2 100644 (file)
@@ -1149,7 +1149,7 @@ class RedCloth < String
         end
     end
     
-    ALLOWED_TAGS = %w(redpre pre code)
+    ALLOWED_TAGS = %w(redpre pre code notextile)
     
     def escape_html_tags(text)
       text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }
index 4f8ededd176f2b49733444ef6578d667a973964a..1e75dbd6489b541ceef9bad9d549aa554f23e9c9 100644 (file)
@@ -153,6 +153,14 @@ class ApplicationHelperTest < HelperTestCase
     to_test.each { |text, result| assert_equal result, textilizable(text) }
   end
   
+  def test_allowed_html_tags
+    to_test = {
+      "<pre>preformatted text</pre>" => "<pre>preformatted text</pre>",
+      "<notextile>no *textile* formatting</notextile>" => "no *textile* formatting",
+    }
+    to_test.each { |text, result| assert_equal result, textilizable(text) }
+  end
+  
   def test_wiki_links_in_tables
     to_test = {"|[[Page|Link title]]|[[Other Page|Other title]]|\n|Cell 21|[[Last page]]|" =>
                  '<tr><td><a href="/wiki/ecookbook/Page" class="wiki-page new">Link title</a></td>' +