aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2006-12-07 22:12:48 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2006-12-07 22:12:48 +0000
commit2f9d44e50beb7c51fd26bf900c4d18986c9ab754 (patch)
tree39cefc61f319902a016056620cee88bbfe67daf7 /actionpack/lib
parent90179a9ba5622075d150b4decfe9716e0424d380 (diff)
downloadrails-2f9d44e50beb7c51fd26bf900c4d18986c9ab754.tar.gz
rails-2f9d44e50beb7c51fd26bf900c4d18986c9ab754.tar.bz2
rails-2f9d44e50beb7c51fd26bf900c4d18986c9ab754.zip
Improved auto_link to match more valid urls correctly
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5704 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 0b1b46b0f3..c921fcae4b 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -356,24 +356,24 @@ module ActionView
end
AUTO_LINK_RE = %r{
- ( # leading text
- <\w+.*?>| # leading HTML tag, or
- [^=!:'"/]| # leading punctuation, or
- ^ # beginning of line
+ ( # leading text
+ <\w+.*?>| # leading HTML tag, or
+ [^=!:'"/]| # leading punctuation, or
+ ^ # beginning of line
)
(
- (?:https?://)| # protocol spec, or
- (?:www\.) # www.*
+ (?:https?://)| # protocol spec, or
+ (?:www\.) # www.*
)
(
- [-\w]+ # subdomain or domain
- (?:\.[-\w]+)* # remaining subdomains or domain
- (?::\d+)? # port
- (?:/(?:[~\w%.;-]+)?)* # path
- (?:\?[\w%&=.;-]+)? # query string
- (?:\#\w*)? # trailing anchor
+ [-\w]+ # subdomain or domain
+ (?:\.[-\w]+)* # remaining subdomains or domain
+ (?::\d+)? # port
+ (?:/(?:[~\w\+%.;-]+)?)* # path
+ (?:\?[\w\+%&=.;-]+)? # query string
+ (?:\#[\w\-]*)? # trailing anchor
)
- ([[:punct:]]|\s|<|$) # trailing text
+ ([[:punct:]]|\s|<|$) # trailing text
}x unless const_defined?(:AUTO_LINK_RE)
# Turns all urls into clickable links. If a block is given, each url