fix(excludeTrailingPunctuationFromURL): add comma to punctuation list

Closes #354
This commit is contained in:
Estevao Soares dos Santos 2017-03-09 00:41:48 +00:00
parent 759a334e13
commit fa35fd5e7e
7 changed files with 7 additions and 1 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

BIN
dist/showdown.min.js vendored

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
// url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
var simpleURLRegex = /\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)()(?=\s|$)(?!["<>])/gi,
simpleURLRegex2 = /\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?()]?)(?=\s|$)(?!["<>])/gi,
simpleURLRegex2 = /\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()"\[\]]?)(?=\s|$)(?!["<>])/gi,
//simpleURLRegex3 = /\b(((https?|ftp):\/\/|www\.)[a-z\d.-]+\.[a-z\d_.~:/?#\[\]@!$&'()*+,;=-]+?)([.!?()]?)(?=\s|$)(?!["<>])/gi,
delimUrlRegex = /<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)>/gi,
simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,

View File

@ -2,3 +2,5 @@
<p>url <a href="http://www.google.com">http://www.google.com</a>!</p>
<p>url <a href="http://www.google.com">http://www.google.com</a>? foo</p>
<p>url (<a href="http://www.google.com">http://www.google.com</a>) bazinga</p>
<p>url [<a href="http://www.google.com">http://www.google.com</a>] bazinga</p>
<p>url <a href="http://www.google.com">http://www.google.com</a>, bar</p>

View File

@ -5,3 +5,7 @@ url http://www.google.com!
url http://www.google.com? foo
url (http://www.google.com) bazinga
url [http://www.google.com] bazinga
url http://www.google.com, bar