Hmm,
Looks like you are using rails 1.2.3 and hitting on a known bug.
You have three options
- Upgrade rails to the latest version.
- Patch rails 1.2.3 installation
Edit
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/text_helper.rb
Replace line 372
(?:/(?:(?:[~\w+%-]|(?:[,.;:][^\s$]))+)?)* # path
with
(?:/(?:(?:[~\w+@%=()-]|(?:[,.;:][^\s$]))+)?)* # path
and line 373
(?:?[\w+%&=.;-]+)? # query string
with
(?:?[\w+@%&=.;-]+)? # query string
- Add local fixes
Add the following right at the end of your environment.rb
require ‘action_view/helpers/tag_helper’
require ‘html/document’
module ActionView
module Helpers
module TextHelper
def auto_link_urls(text, href_options = {})
extra_options = tag_options(href_options.stringify_keys) || “”
text.gsub(AUTO_LINK_RE) do
all, a, b, c, d = $&, $1, $2, $3, $4
if a =~ /<a\s/i # don’t replace URL’s that are already linked
all
else
text = b + c
text = yield(text) if block_given?
%(#{a}<a href=“#{b==“www.”?“http://www
.”:b}#{c}”#{extra_options}>#{text}#{d})
end
end
end
private
AUTO_LINK_RE = %r{
( # leading text
<\w+.*?>| # leading HTML tag, or
[^=!:'"/]| # leading punctuation, or
^ # beginning of line
)
(
(?:https?://)| # protocol spec, or
(?:www\.) # www.*
)
(
[-\w]+ # subdomain or domain
(?:\.[-\w]+)* # remaining subdomains or domain
(?::\d+)? # port
(?:/(?:(?:[~\w\+@%=\(\)-]|(?:[,.;:][^\s$]))+)?)* # path
(?:\?[\w\+@%&=.;-]+)? # query string
(?:\#[\w\-]*)? # trailing anchor
)
([[:punct:]]|<|$|) # trailing text
}x unless const_defined?(:AUTO_LINK_RE)
end
end
end
Let me know if that works.
Cheers,
Ganesh G…
SageWork(http://sagework.com) Simplify IT
On Fri, Jul 25, 2008 at 6:54 PM, Sunny B. <