diff --git a/dist/showdown.js b/dist/showdown.js index 15bc079..b82bc39 100644 Binary files a/dist/showdown.js and b/dist/showdown.js differ diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 65a4772..d979b2b 100644 Binary files a/dist/showdown.js.map and b/dist/showdown.js.map differ diff --git a/dist/showdown.min.js b/dist/showdown.min.js index cd24e4f..db8592b 100644 Binary files a/dist/showdown.min.js and b/dist/showdown.min.js differ diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index ca06c14..934d73c 100644 Binary files a/dist/showdown.min.js.map and b/dist/showdown.min.js.map differ diff --git a/src/subParsers/autoLinks.js b/src/subParsers/autoLinks.js index cc03aca..e51eb65 100644 --- a/src/subParsers/autoLinks.js +++ b/src/subParsers/autoLinks.js @@ -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, diff --git a/test/features/excludeTrailingPunctuationFromURLs-option.html b/test/features/excludeTrailingPunctuationFromURLs-option.html index 6b33489..80a4264 100644 --- a/test/features/excludeTrailingPunctuationFromURLs-option.html +++ b/test/features/excludeTrailingPunctuationFromURLs-option.html @@ -2,3 +2,5 @@
url http://www.google.com? foo
url (http://www.google.com) bazinga
+url [http://www.google.com] bazinga
+url http://www.google.com, bar
diff --git a/test/features/excludeTrailingPunctuationFromURLs-option.md b/test/features/excludeTrailingPunctuationFromURLs-option.md index c5fcdd6..3ea0eb5 100644 --- a/test/features/excludeTrailingPunctuationFromURLs-option.md +++ b/test/features/excludeTrailingPunctuationFromURLs-option.md @@ -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