From 207dbb71c4ea838c8ccaed1dcb2a86254cfac2f6 Mon Sep 17 00:00:00 2001 From: Eugene Pimenov Date: Thu, 1 May 2008 09:37:10 +0400 Subject: [PATCH] auto_link helper fails to recognize links separated by space. [#72 state:resolved] --- actionpack/lib/action_view/helpers/text_helper.rb | 2 +- actionpack/test/template/text_helper_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index f8c3b67..9a4571a 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -463,7 +463,7 @@ module ActionView ( # leading text <\w+.*?>| # leading HTML tag, or [^=!:'"/]| # leading punctuation, or - ^ # beginning of line + | # nothing ) ( (?:https?://)| # protocol spec, or diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 25ecda6..b45305c 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -271,6 +271,7 @@ class TextHelperTest < ActionView::TestCase assert_equal email2_result, auto_link(email2_raw) assert_equal '', auto_link(nil) assert_equal '', auto_link('') + assert_equal "#{link_result} #{link_result} #{link_result}", auto_link("#{link_raw} #{link_raw} #{link_raw}") end def test_auto_link_at_eol -- 1.5.5.43.g74bd6