Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

auto_link should not linkify URLs in the middle of a tag

#1523

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

Reported by Eugene Pimenov · December 7th, 2008 @ 04:01 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Eugene Pimenov
  2. Eugene Pimenov
    Eugene Pimenov

    The last comment was about a href=" check, because it's in the middle of a tag either.

    December 7th, 2008 @ 04:11 PM

  3. Henrik Nyh
    Henrik Nyh

    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" />')

    February 28th, 2009 @ 11:30 AM

  4. Henrik Nyh
    Henrik Nyh

    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>
    

    February 28th, 2009 @ 11:32 AM

  5. Mislav
    Mislav

    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.

    February 28th, 2009 @ 03:29 PM

  6. Repository
    Repository
    • State changed from new to resolved

    (from [bdfa733d04c5843eadc181f2fd1723db614fc3d0]) Ensure auto_link doesnt linkify URLs in the middle of a tag [#1523 auto_link should not linkify URLs in the middle of a tag state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    March 10th, 2009 @ 05:04 PM