robinst / autolink-java

Java library to extract links (URLs, email addresses) from plain text; fast, small and smart
MIT License
207 stars 40 forks source link

Issue in extracting links if they are just extracted by commas #34

Closed samwebber11 closed 4 years ago

samwebber11 commented 4 years ago

I had been trying to separate URL with String res = " https://www.gooogle.com,https://facebook.com and www.googlle.com";

Now this gives me the result.

  1. https://www.gooogle.com,https://facecbook.com
  2. www.googlle.com

But the required result must be

  1. https://www.gooogle.com
  2. https://facebook.com
  3. www.googlle.com

I think this library does not extract links even if they are separated by commas. Look if anyone can help with this.

Thank You.

robinst commented 4 years ago

Hey, thanks for reporting this. Unfortunately, URLs can contain commas without having to be escaped. So if we split URLs on commas, we'd split up potentially valid URLs and break them.

Note that GitHub has the same logic of not splitting on commas, as you can see in your comment.