]> source.dussan.org Git - redmine.git/commitdiff
Merged r17322 from trunk to 3.3-stable (#28469).
authorGo MAEDA <maeda@farend.jp>
Wed, 2 May 2018 02:30:36 +0000 (02:30 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 2 May 2018 02:30:36 +0000 (02:30 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@17324 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/textile/formatter.rb
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb

index a698cad45666968ede5908dad9cbf691e9daf3df..4d4e4b24009ea7f67140e2bbdaafb1a71a70e56f 100644 (file)
@@ -120,7 +120,7 @@ module Redmine
             ## replace <pre> content
             text.gsub!(/<redpre#(\d+)>/) do
               content = @pre_list[$1.to_i]
-              if content.match(/<code\s+class="(\w+)">\s?(.+)/m)
+              if content.match(/<code\s+class=["'](\w+)["']>\s?(.+)/m)
                 language = $1
                 text = $2
                 if Redmine::SyntaxHighlighting.language_supported?(language)
index 7e5ef8cb2516246fcb5dd43f16e6dbd7abac4839..8920a6ae96a287c86582e6afae20730184c32afb 100644 (file)
@@ -542,7 +542,10 @@ STR
   end
 
   def test_should_allow_valid_language_class_attribute_on_code_tags
+    # language name is double-quoted
     assert_html_output({"<code class=\"ruby\">test</code>" => "<code class=\"ruby syntaxhl\"><span class=\"CodeRay\">test</span></code>"}, false)
+    # language name is single-quoted
+    assert_html_output({"<code class='ruby'>test</code>" => "<code class=\"ruby syntaxhl\"><span class=\"CodeRay\">test</span></code>"}, false)
   end
 
   def test_should_not_allow_valid_language_class_attribute_on_non_code_offtags