Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10336: auto_link_re_patch.diff

File auto_link_re_patch.diff, 1.5 kB (added by dim, 11 months ago)

PATCH for AUTO_LINK_RE

  • actionpack/test/template/text_helper_test.rb

    old new  
    243243    assert_equal %(<p><a href="#{url1}">#{url1}</a><br /><a href="#{url2}">#{url2}</a><br /></p>), auto_link("<p>#{url1}<br />#{url2}<br /></p>") 
    244244  end 
    245245 
     246  def test_auto_link_with_dot_at_eol 
     247    url1 = "http://retrospectiva.org/wiki/" 
     248    assert_equal %(<p>See <a href="#{url1}">#{url1}</a>.</p>), auto_link("<p>See #{url1}.</p>") 
     249  end 
     250 
    246251  def test_auto_link_with_block 
    247252    url = "http://api.rubyonrails.com/Foo.html" 
    248253    email = "fantabulous@shiznadel.ic" 
  • actionpack/lib/action_view/helpers/text_helper.rb

    old new  
    436436                          [-\w]+                   # subdomain or domain 
    437437                          (?:\.[-\w]+)*            # remaining subdomains or domain 
    438438                          (?::\d+)?                # port 
    439                           (?:/(?:(?:[~\w\+@%-]|(?:[,.;:][^\s$]))+)?)* # path 
     439                          (?:/(?:(?:[~\w\+@%-]|(?:[,.;:][^\s<$]))+)?)* # path 
    440440                          (?:\?[\w\+@%&=.;-]+)?     # query string 
    441441                          (?:\#[\w\-]*)?           # trailing anchor 
    442442                        )