Skip to content

Instantly share code, notes, and snippets.

@vinitkumar
Created April 6, 2014 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinitkumar/10000895 to your computer and use it in GitHub Desktop.
Save vinitkumar/10000895 to your computer and use it in GitHub Desktop.
// 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>');
})
}
@barrydegraaff
Copy link

Hello vinitkumar,

This is a nice function, could you declare a license or copyright on this? I would prefer a GNU GPL one.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment