Last active
May 28, 2019 13:50
-
-
Save edjw/82d2476c9304f797a69776bcdd0c22b3 to your computer and use it in GitHub Desktop.
Wrap bare urls in a:href or markdown link
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
HTML | |
Find: (http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])? | |
Replace: <a href="$0">$0</a> | |
Markdown | |
Find: ((http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?) | |
Replace: [$1]($1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't ignore urls that already wrapped by a:href