Turn ftps and sftp proto into links (#1514).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2018 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-11-11 14:24:06 +00:00
parent ad97165f1b
commit cbacc71dff
2 changed files with 4 additions and 1 deletions

View File

@ -135,7 +135,7 @@ module Redmine
)
(
(?:https?://)| # protocol spec, or
(?:ftp://)|
(?:s?ftps?://)|
(?:www\.) # www.*
)
(

View File

@ -36,6 +36,7 @@ class ApplicationHelperTest < HelperTestCase
'http://foo.bar' => '<a class="external" href="http://foo.bar">http://foo.bar</a>',
'http://foo.bar/~user' => '<a class="external" href="http://foo.bar/~user">http://foo.bar/~user</a>',
'http://foo.bar.' => '<a class="external" href="http://foo.bar">http://foo.bar</a>.',
'https://foo.bar.' => '<a class="external" href="https://foo.bar">https://foo.bar</a>.',
'This is a link: http://foo.bar.' => 'This is a link: <a class="external" href="http://foo.bar">http://foo.bar</a>.',
'A link (eg. http://foo.bar).' => 'A link (eg. <a class="external" href="http://foo.bar">http://foo.bar</a>).',
'http://foo.bar/foo.bar#foo.bar.' => '<a class="external" href="http://foo.bar/foo.bar#foo.bar">http://foo.bar/foo.bar#foo.bar</a>.',
@ -52,6 +53,8 @@ class ApplicationHelperTest < HelperTestCase
'http://foo@www.bar.com' => '<a class="external" href="http://foo@www.bar.com">http://foo@www.bar.com</a>',
'http://foo:bar@www.bar.com' => '<a class="external" href="http://foo:bar@www.bar.com">http://foo:bar@www.bar.com</a>',
'ftp://foo.bar' => '<a class="external" href="ftp://foo.bar">ftp://foo.bar</a>',
'ftps://foo.bar' => '<a class="external" href="ftps://foo.bar">ftps://foo.bar</a>',
'sftp://foo.bar' => '<a class="external" href="sftp://foo.bar">sftp://foo.bar</a>',
}
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end