diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index f63d119..d271769 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -537,7 +537,7 @@ module ActionView href = $& punctuation = '' # detect already linked URLs - if $` =~ /]*href="$/ + if $` =~ /]*href="$|]*src="$/ # do not change string; URL is alreay linked href else diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 816b496..975dfae 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -359,6 +359,8 @@ class TextHelperTest < ActionView::TestCase email_raw = "david@loudthinking.com" email_linked = %(Mail me!) assert_equal email_linked, auto_link(email_linked) + image = %() + assert_equal image, auto_link(image) end def test_auto_link_with_brackets