Skip to content

Instantly share code, notes, and snippets.

@latentflip
Created November 6, 2013 11:21
Show Gist options
  • Save latentflip/7334524 to your computer and use it in GitHub Desktop.
Save latentflip/7334524 to your computer and use it in GitHub Desktop.
String.prototype.link = function(url) {
var html, text=this;
//Strings in JS have a .link() method, pretty handy, see:
html="<a href='"+url+"'>"+text+"</a>"; //before
//html=text.link(url); //after
return html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment