Created
May 16, 2013 17:49
-
-
Save willread/5593619 to your computer and use it in GitHub Desktop.
Make URLs in a string clickable.
This file contains hidden or 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
"string http://domain.tld/path with a URL".replace(/(http[s]?:\/\/)([^\s]+)/, "<a href='$1$2'>$2</a>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment