diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-05-25 11:16:46 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-25 11:16:46 +0100 |
commit | dc6da2e3701f370ce7fa997c4d4dea22998f7150 (patch) | |
tree | 805759f9f2f942a3c80b80cb8cf996a6494c8b54 /actionpack | |
parent | 11ea3e947a1b5a59a5f77ba392a32f57e157903e (diff) | |
parent | 6277fd91133a3566333612857510d74de60d67f4 (diff) | |
download | rails-dc6da2e3701f370ce7fa997c4d4dea22998f7150.tar.gz rails-dc6da2e3701f370ce7fa997c4d4dea22998f7150.tar.bz2 rails-dc6da2e3701f370ce7fa997c4d4dea22998f7150.zip |
Merge commit 'mainstream/master'
Conflicts:
railties/configs/initializers/new_rails_defaults.rb
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 4 | ||||
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index b710157f51..669a285424 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -454,7 +454,7 @@ module ActionView ( # leading text <\w+.*?>| # leading HTML tag, or [^=!:'"/]| # leading punctuation, or - | # nothing + ^ # beginning of line ) ( (?:https?://)| # protocol spec, or @@ -468,7 +468,7 @@ module ActionView (?:\?[\w\+@%&=.;-]+)? # query string (?:\#[\w\-]*)? # trailing anchor ) - ([[:punct:]]|\s|<|$) # trailing text + ([[:punct:]]|<|$|) # trailing text }x unless const_defined?(:AUTO_LINK_RE) # Turns all urls into clickable links. If a block is given, each url diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 36c939f761..62cdca03d1 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -264,6 +264,7 @@ class TextHelperTest < ActionView::TestCase 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}") + assert_equal '<a href="http://www.rubyonrails.com">Ruby On Rails</a>', auto_link('<a href="http://www.rubyonrails.com">Ruby On Rails</a>') end def test_auto_link_at_eol |