Fixed that www followed by a dot generates broken links in formatted text (#3676).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11473 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-02-24 12:39:06 +00:00
parent 458800c1d5
commit dfca67d844
2 changed files with 5 additions and 2 deletions

View File

@ -95,7 +95,7 @@ module Redmine
(?:www\.) # www.*
)
(
(\S+?) # url
([^<]\S*?) # url
(\/)? # slash
)
((?:&gt;)?|[^[:alnum:]_\=\/;\(\)]*?) # post

View File

@ -84,7 +84,10 @@ class ApplicationHelperTest < ActionView::TestCase
# escaping
'http://foo"bar' => '<a class="external" href="http://foo&quot;bar">http://foo&quot;bar</a>',
# wrap in angle brackets
'<http://foo.bar>' => '&lt;<a class="external" href="http://foo.bar">http://foo.bar</a>&gt;'
'<http://foo.bar>' => '&lt;<a class="external" href="http://foo.bar">http://foo.bar</a>&gt;',
# invalid urls
'http://' => 'http://',
'www.' => 'www.',
}
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end