vmg / rinku

Autolinking. Ruby. Yes, that's pretty much it.
ISC License
597 stars 67 forks source link

Don't email autolink if only period is at end #56

Closed kivikakk closed 8 years ago

kivikakk commented 8 years ago

See test case:

  def test_non_emails_ending_in_periods
    assert_linked "abc/def@ghi.", "abc/def@ghi."
    assert_linked "abc/def@ghi. ", "abc/def@ghi. "
    assert_linked "abc/def@ghi. x", "abc/def@ghi. x"
    assert_linked "abc/def@ghi.< x", "abc/def@ghi.< x"
    assert_linked "abc/<a href=\"mailto:def@ghi.x\">def@ghi.x</a>", "abc/def@ghi.x"
    assert_linked "abc/<a href=\"mailto:def@ghi.x\">def@ghi.x</a>. a", "abc/def@ghi.x. a"
  end
vmg commented 8 years ago

Ah this is a good fix.