Skip to content

Commit 3a6a328

Browse files
committed
Support single quotes in urls and query strings per RFC 3986
1 parent b7167df commit 3a6a328

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

dist/Autolinker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241

242242
// Allow optional path, query string, and hash anchor, not ending in the following characters: "!:,.;"
243243
// http://blog.codinghorror.com/the-problem-with-urls/
244-
urlSuffixRegex = /(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;\$\*]*[\-A-Za-z0-9+&@#\/%=~_()|\$\*])?/; // note: optional part of the full regex
244+
urlSuffixRegex = /(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;'\$\*]*[\-A-Za-z0-9+&@#\/%=~_()|'\$\*])?/; // note: optional part of the full regex
245245

246246
return new RegExp( [
247247
'(', // *** Capturing group $1, which can be used to check for a twitter handle match. Use group $3 for the actual twitter handle though. $2 may be used to reconstruct the original string in a replace()

0 commit comments

Comments
 (0)