OSDN Git Service

Fixed: Double-dash results in strikethrough text (#5122).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 20 Mar 2010 12:54:23 +0000 (12:54 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 20 Mar 2010 12:54:23 +0000 (12:54 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3605 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redcloth3.rb
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb

index fb96916..045d44f 100644 (file)
@@ -381,9 +381,11 @@ class RedCloth3 < String
             case rtype
             when :limit
                 /(^|[>\s\(])          # sta
+                (?!\-\-)
                 (#{QTAGS_JOIN}|)      # oqs
                 (#{rcq})              # qtag
                 (\w|[^\s].*?[^\s])    # content
+                (?!\-\-)
                 #{rcq}
                 (#{QTAGS_JOIN}|)      # oqa
                 (?=[[:punct:]]|\s|\)|$)/x
index a64690d..d5fbd72 100644 (file)
@@ -71,6 +71,13 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase
     )
   end
   
+  def test_double_dashes_should_not_strikethrough
+    assert_html_output(
+      'double -- dashes -- test'  => 'double -- dashes -- test',
+      'double -- *dashes* -- test'  => 'double -- <strong>dashes</strong> -- test'
+    )
+  end
+  
   private
   
   def assert_html_output(to_test)