Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created November 28, 2011 23:02
Show Gist options
  • Save mahemoff/1402507 to your computer and use it in GitHub Desktop.
Save mahemoff/1402507 to your computer and use it in GitHub Desktop.
control freak script: linkify text file (quick hack)
var re = /http:\/\/\S+/g;
var s = document.body.innerHTML;
var m;
do {
m = re.exec(s);
if (m) {
console.log(m[0]);
document.body.innerHTML += '<li> <a href="'+m[0]+'">'+m[0]+'</a>';
}
} while (m);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment