This project is archived and is in readonly mode.
auto_link should not linkify URLs in the middle of a tag
Reported by Eugene Pimenov | December 7th, 2008 @ 04:01 PM | in 2.x
auto_link wraps into a link URLs written in the middle of a tag (ie, src attribute of IMG tag would became a tag into another tag)
The bug was introduced in c6c5cd554110f6e62290de3e3008076b2f69e7cb (Nov 12)… git apply works against master
Comments and changes to this ticket
-

-

Eugene Pimenov December 7th, 2008 @ 04:11 PM
The last comment was about a href=" check, because it's in the middle of a tag either.
-

Henrik Nyh February 28th, 2009 @ 11:30 AM
Just ran into this, upgrading an app from 2.2 to 2.3.
auto_link('
') in 2.2: auto_link('
')
in 2.3: auto_link('http://google.com/image.jpg" />')
-

Henrik Nyh February 28th, 2009 @ 11:32 AM
Let's try that again.
auto_link('<a href="http://google.com"><img src="http://google.com/image.jpg" /></a>')in 2.2:
<a href="http://google.com"><img src="http://google.com/image.jpg" /></a>in 2.3:
<a href="http://google.com"><img src="<a href="http://google.com/image.jpg">http://google.com/image.jpg</a>" /></a> -

Mislav February 28th, 2009 @ 03:29 PM
Good catch -- it definitely slipped my mind.
I would only change the check like this:
if left =~ /<[^>]+$/ && right =~ /^[^<]+>/Now the right regexp reflects the left.
-

Repository March 10th, 2009 @ 05:04 PM
- State changed from new to resolved
(from [bdfa733d04c5843eadc181f2fd1723db614fc3d0]) Ensure auto_link doesnt linkify URLs in the middle of a tag [#1523 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
-
1862
Running autolink on text containing a mailto: link breaks
References #1523 [#1862 state:resolved] [#3591
state:reso...
-
2017
Should not html_escape auto_link block form
References #1523 [#1862 state:resolved] [#3591
state:reso...
-
3591
auto_link should not create a link inside a link which has the rel attribute
References #1523 [#1862 state:resolved] [#3591
state:reso...
-
1862
Running autolink on text containing a mailto: link breaks
References #1523 [#1862 state:resolved] [#3591
state:reso...
-
3591
auto_link should not create a link inside a link which has the rel attribute
References #1523 [#1862 state:resolved] [#3591
state:reso...
-
2017
Should not html_escape auto_link block form
References #1523 [#1862 state:resolved] [#3591
state:reso...
-
1523
auto_link should not linkify URLs in the middle of a tag
(from [bdfa733d04c5843eadc181f2fd1723db614fc3d0]) Ensure
...
-
1862
Running autolink on text containing a mailto: link breaks
The second issue (IMG tag) was resolved in #1523.
-
1862
Running autolink on text containing a mailto: link breaks
Thanks for taking the time to look at my patch. I was not...