From 6426b63a4a239f45fb6d9c91fe2b7ef4e346e36b Mon Sep 17 00:00:00 2001 From: Rob Sutherland Date: Fri, 11 May 2012 11:54:11 -0500 Subject: [PATCH] initial attempt at matching @twitter username automatically --- src/showdown.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/showdown.js b/src/showdown.js index 43920d9..9fdab9a 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -1129,6 +1129,9 @@ var _DoAutoLinks = function(text) { text = text.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"$1"); + // Twitter: @twitter_username + text = text.replace(/\s@([-\w])/gi,"$1"); + // Email addresses: /*