Skip to content

Commit c5464ba

Browse files
committed
Fix for twitter handles within parenthesis or brackets.
1 parent 5bffb09 commit c5464ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Autolinker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
* This also includes a path, url parameters, or hash anchors. Ex: google.com/path/to/file?q1=1&q2=2#myAnchor
138138
*/
139139
matcherRegex: (function() {
140-
var twitterRegex = /(^|\s)@(\w{1,15})/, // For matching a twitter handle. Ex: @gregory_jacobs
140+
var twitterRegex = /(^|[^\w])@(\w{1,15})/, // For matching a twitter handle. Ex: @gregory_jacobs
141141

142142
emailRegex = /(?:[\-;:&=\+\$,\w\.]+@)/, // something@ for email addresses (a.k.a. local-part)
143143

0 commit comments

Comments
 (0)