]> source.dussan.org Git - redmine.git/commitdiff
Merged r4468 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 18 Dec 2010 17:22:43 +0000 (17:22 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 18 Dec 2010 17:22:43 +0000 (17:22 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4538 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index ffc0e1186be039722da0f6bc336b7216e04d83a0..4d8e934f569f1ad1996433b9af7bd2c230d117a8 100644 (file)
@@ -1078,7 +1078,7 @@ class RedCloth3 < String
                         line = "<redpre##{ @pre_list.length }>"
                         first.match(/<#{ OFFTAGS }([^>]*)>/)
                         tag = $1
-                        $2.to_s.match(/(class\=\S+)/i)
+                        $2.to_s.match(/(class\=("[^"]+"|'[^']+'))/i)
                         tag << " #{$1}" if $1
                         @pre_list << "<#{ tag }>#{ aftertag }"
                     end
index 16ef601827647c29a751da6f7b97d88ff44d4736..dd848630427a879527d0e58dd2a02539e85a9d01 100644 (file)
@@ -284,6 +284,9 @@ RAW
       "<!-- opening comment" => "<p>&lt;!-- opening comment</p>",
       # remove attributes except class
       "<pre class='foo'>some text</pre>" => "<pre class='foo'>some text</pre>",
+      '<pre class="foo">some text</pre>' => '<pre class="foo">some text</pre>',
+      "<pre class='foo bar'>some text</pre>" => "<pre class='foo bar'>some text</pre>",
+      '<pre class="foo bar">some text</pre>' => '<pre class="foo bar">some text</pre>',
       "<pre onmouseover='alert(1)'>some text</pre>" => "<pre>some text</pre>",
     }
     to_test.each { |text, result| assert_equal result, textilizable(text) }