- # Multiple valid phone numbers separated by ;
- links = email_links("email", "test@email.com; example@s.example")
- assert_equal 2, links.length
- assert_equal "test@email.com", links[0][:email]
- assert_equal "mailto:test@email.com", links[0][:url]
- assert_equal "example@s.example", links[1][:email]
- assert_equal "mailto:example@s.example", links[1][:url]
-
- links = email_links("email", "x@example.com ; dash-in@both-parts.com ")
- assert_equal 2, links.length
- assert_equal "x@example.com", links[0][:email]
- assert_equal "mailto:x@example.com", links[0][:url]
- assert_equal "dash-in@both-parts.com", links[1][:email]
- assert_equal "mailto:dash-in@both-parts.com", links[1][:url]
+ # Strips whitespace at ends
+ email = email_link("email", " test@email.com ")
+ assert_equal "test@email.com", email[:email]
+ assert_equal "mailto:test@email.com", email[:url]