Fixed: auto links ending with right angle bracket shouldn't include the bracket in the URL. #5652

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4287 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Baptiste Barth 2010-10-23 22:35:02 +00:00
parent 7824eca775
commit d642964035
2 changed files with 3 additions and 1 deletions

View File

@ -121,7 +121,7 @@ module Redmine
(\S+?) # url (\S+?) # url
(\/)? # slash (\/)? # slash
) )
([^\w\=\/;\(\)]*?) # post ((?:>)?|[^\w\=\/;\(\)]*?) # post
(?=<|\s|$) (?=<|\s|$)
}x unless const_defined?(:AUTO_LINK_RE) }x unless const_defined?(:AUTO_LINK_RE)

View File

@ -79,6 +79,8 @@ class ApplicationHelperTest < ActionView::TestCase
'http://example.net/path!602815048C7B5C20!302.html' => '<a class="external" href="http://example.net/path!602815048C7B5C20!302.html">http://example.net/path!602815048C7B5C20!302.html</a>', 'http://example.net/path!602815048C7B5C20!302.html' => '<a class="external" href="http://example.net/path!602815048C7B5C20!302.html">http://example.net/path!602815048C7B5C20!302.html</a>',
# escaping # escaping
'http://foo"bar' => '<a class="external" href="http://foo&quot;bar">http://foo"bar</a>', 'http://foo"bar' => '<a class="external" href="http://foo&quot;bar">http://foo"bar</a>',
# wrap in angle brackets
'<http://foo.bar>' => '&lt;<a class="external" href="http://foo.bar">http://foo.bar</a>&gt;'
} }
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end end