Project

General

Profile

Defect #30371 » 0002-URL-followed-by-tag.patch

Yuichi HARADA, 2019-01-23 07:23

View differences:

lib/redmine/wiki_formatting.rb
(\/)? # slash
)
((?:>)?|[^[:alnum:]_\=\/;\(\)]*?) # post
(?=<|\s|$)
(?=&lt;|<|\s|$)
}x unless const_defined?(:AUTO_LINK_RE)
# Destructively replaces urls into clickable links
lib/redmine/wiki_formatting/textile/redcloth3.rb
(\/)? # $slash
([^[:alnum:]_\=\/;\(\)]*?) # $post
)
(?=<|\s|$)
(?=&lt;|<|\s|$)
/x
#"
def inline_textile_link( text )
test/helpers/application_helper_test.rb
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end
def test_textile_external_links_with_followed_by_tag
to_test = {
'"test":http://foo/bar&lt;baz&gt;' => '<a href="http://foo/bar" class="external">test</a>&lt;baz&gt;',
}
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end
def test_redmine_links
user_with_email_login = User.generate!(:login => 'abcd@example.com')
user_with_email_login_2 = User.generate!(:login => 'foo.bar@example.com')
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '')
end
def test_should_link_url_with_followed_by_tag
assert_html_output({
'http://www.redmine.org/example&lt;foo&gt;' => '<a class="external" href="http://www.redmine.org/example">http://www.redmine.org/example</a>&lt;foo&gt;',
})
end
private
def assert_html_output(to_test, expect_paragraph = true)
(3-3/3)