Consider supporting multiple links separated by punctuation
Given the strings:
http://www.a.com http://www.b.comhttp://www.a.com, http://www.b.com, and http://www.c.com.
Expected output:
<a href="http://www.a.com" target="_self">http://www.a.com</a> <a href="http://www.b.com" target="_self">http://www.b.com</a><a href="http://www.a.com" target="_self">http://www.a.com</a>, <a href="http://www.b.com" target="_self">http://www.b.com</a>, and <a href="http://www.c.com" target="_self">http://www.c.com</a>.
Observed output:
<a href="http://www.a.com" target="_self">http://www.a.com</a> http://www.b.comhttp://www.a.com, http://www.b.com, and http://www.c.com.
FWIW,
http://www.a.com, ...yieldshttp://www.a.com, ..., however appending a slashhttp://www.a.com/, ...yields (note the trailing punctuation is included in the link)<a href="http://www.a.com/," target="_self">http://www.a.com/,</a> ...- and separating links with multiple spaces (spaces not preserved by Markdown)
http://www.a.com http://www.b.comyields<a href="http://www.a.com" target="_self">http://www.a.com</a> <a href="//www.b.com" target="_self">www.b.com</a>
Thanks for opening this issue! Definitely agree that we should support this better. When I get a chance I will dive into the regex a bit to see how I can get the expected output to be produced.
+1 for this.
+1
Version 3.0.0 handles space delimited list of URLs as expected now
Want me to split the comma-delimited issue into a separate issue? IMO that's the more likely use-case.
@nwhittaker I'll reopen it so we're tracking against the punctuation case.
@nwhittaker I have a PR for this. Can you drop in and give some input?
Any way to detect the delimiter programmatically? Or at least make a best guess? I suspect the typical usage of this helper (at least it is in my case) is to pass it dynamic or user-entered content. So the delimiter isn't always knowable (or guaranteed consistent) ahead of time.