Skip to content

Commit

Permalink
fix(excludeTrailingPunctuationFromURLs): fix weird character when thi…
Browse files Browse the repository at this point in the history
…s option with simplifiedAutoLinks

Closes #378
  • Loading branch information
tivie committed Apr 23, 2017
1 parent 1bca88f commit 71acff5
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/subParsers/autoLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var simpleURLRegex = /\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,
delimUrlRegex = /<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>/gi,
simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Example <a href="http://example.com">http://example.com</a></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Example <http://example.com>
2 changes: 2 additions & 0 deletions test/node/testsuite.features.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ describe('makeHtml() features testsuite', function () {
converter = new showdown.Converter({prefixHeaderId: 'my prefix ', ghCompatibleHeaderId: true});
} else if (testsuite[i].name === 'simplifiedAutoLink') {
converter = new showdown.Converter({simplifiedAutoLink: true, strikethrough: true});
} else if (testsuite[i].name === '#378.simplifiedAutoLinks-with-excludeTrailingPunctuationFromURLs') {
converter = new showdown.Converter({simplifiedAutoLink: true, excludeTrailingPunctuationFromURLs: true});
} else {
converter = new showdown.Converter();
}
Expand Down

0 comments on commit 71acff5

Please sign in to comment.