Commit cbacc71d authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

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
parent ad97165f
......@@ -135,7 +135,7 @@ module Redmine
)
(
(?:https?://)| # protocol spec, or
(?:ftp://)|
(?:s?ftps?://)|
(?:www\.) # www.*
)
(
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment