Skip to content

Instantly share code, notes, and snippets.

@zmack
Created January 8, 2009 12:10
Show Gist options
  • Save zmack/44703 to your computer and use it in GitHub Desktop.
Save zmack/44703 to your computer and use it in GitHub Desktop.
$('li span.content').each( function(index,element) { z = element.innerHTML.match(/http:\/\/([^/]+)[^ ]+/); if ( z!= null) { console.log(element.innerHTML); element.innerHTML = element.innerHTML.replace(z[0], '<a href="'+z[0]+'">'+z[1]+'</a>') } })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment