Fixes_user_mention_at_the_end_of_line_.patch

Dmitry Makurin , 2021-03-15 13:54

Download (1.53 KB)

View differences:

test/helpers/application_helper_test.rb (date 1615812440651)
2000 2000
    end
2001 2001
  end
2002 2002

  
2003
  def test_parse_redmine_links_should_correctly_handle_user_login_at_line_end
2004
    expected = "<p>#{link_to_user(User.find_by(:id => 2))}.</p>"
2005
    %w[<p>@jsmith.</p> <p>user:jsmith.</p> <p>user#2.</p>].each do |text|
2006
      s = +text
2007
      parse_redmine_links(s, nil, nil, nil, true, {})
2008
      assert_equal expected, s
2009
    end
2010
  end
2011

  
2003 2012
  private
2004 2013

  
2005 2014
  def wiki_links_with_special_characters
app/helpers/application_helper.rb (date 1615812094494)
1251 1251
              )|
1252 1252
              (
1253 1253
              (?<sep4>@)
1254
              (?<identifier3>[A-Za-z0-9_\-@\.]*)
1254
              (?<identifier3>[A-Za-z0-9_\-@\.]*?)
1255 1255
              )
1256 1256
            )
1257 1257
            (?=