Restricts characters before auto links (#10277).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11474 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
dfca67d844
commit
5b4a9ac3b3
|
@ -86,7 +86,7 @@ module Redmine
|
||||||
AUTO_LINK_RE = %r{
|
AUTO_LINK_RE = %r{
|
||||||
( # leading text
|
( # leading text
|
||||||
<\w+.*?>| # leading HTML tag, or
|
<\w+.*?>| # leading HTML tag, or
|
||||||
[^=<>!:'"/]| # leading punctuation, or
|
[\s\(\[,;]| # leading punctuation, or
|
||||||
^ # beginning of line
|
^ # beginning of line
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
|
|
|
@ -88,6 +88,7 @@ class ApplicationHelperTest < ActionView::TestCase
|
||||||
# invalid urls
|
# invalid urls
|
||||||
'http://' => 'http://',
|
'http://' => 'http://',
|
||||||
'www.' => 'www.',
|
'www.' => 'www.',
|
||||||
|
'test-www.bar.com' => 'test-www.bar.com',
|
||||||
}
|
}
|
||||||
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
|
||||||
|
@ -104,8 +105,11 @@ class ApplicationHelperTest < ActionView::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_auto_mailto
|
def test_auto_mailto
|
||||||
assert_equal '<p><a class="email" href="mailto:test@foo.bar">test@foo.bar</a></p>',
|
to_test = {
|
||||||
textilizable('test@foo.bar')
|
'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
|
end
|
||||||
|
|
||||||
def test_inline_images
|
def test_inline_images
|
||||||
|
|
Loading…
Reference in New Issue