Created
April 6, 2014 02:51
-
-
Save vinitkumar/10000895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helper function to urlify links in the text. | |
function urlify(text) { | |
var urlRegex = /(https?:\/\/[^\s]+)/g; | |
return text.replace(urlRegex, function(url) { | |
return text.replace(urlRegex, '<a href="$1" target="_blank">$1</a>'); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello vinitkumar,
This is a nice function, could you declare a license or copyright on this? I would prefer a GNU GPL one.
Thanks