]> source.dussan.org Git - redmine.git/commitdiff
Merged r11474 from trunk (#10277).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Mar 2013 09:17:37 +0000 (09:17 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Mar 2013 09:17:37 +0000 (09:17 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11566 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting.rb
test/unit/helpers/application_helper_test.rb

index 2a3023a094c9d518899fd6304385d425c88143c1..9a62bf6b8dc1bb09114523f70f8796e75658f014 100644 (file)
@@ -86,7 +86,7 @@ module Redmine
       AUTO_LINK_RE = %r{
                       (                          # leading text
                         <\w+.*?>|                # leading HTML tag, or
-                        [^=<>!:'"/]|             # leading punctuation, or
+                        [\s\(\[,;]|              # leading punctuation, or
                         ^                        # beginning of line
                       )
                       (
index 250f3fb5a30ae8eba2e228a34c93760c6cdb9c31..17219cf2a8ab42d0dfc5ba6271ad05990bc685fd 100644 (file)
@@ -88,6 +88,7 @@ class ApplicationHelperTest < ActionView::TestCase
       # invalid urls
       'http://' => 'http://',
       'www.' => 'www.',
+      'test-www.bar.com' => 'test-www.bar.com',
     }
     to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
   end
@@ -104,8 +105,11 @@ class ApplicationHelperTest < ActionView::TestCase
   end
 
   def test_auto_mailto
-    assert_equal '<p><a class="email" href="mailto:test@foo.bar">test@foo.bar</a></p>',
-      textilizable('test@foo.bar')
+    to_test = {
+      'test@foo.bar' => '<a class="email" href="mailto:test@foo.bar">test@foo.bar</a>',
+      'test@www.foo.bar' => '<a class="email" href="mailto:test@www.foo.bar">test@www.foo.bar</a>',
+    }
+    to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
   end
 
   def test_inline_images