Skip to content

Instantly share code, notes, and snippets.

@jaseflow
Created January 24, 2013 01:32
Show Gist options
  • Save jaseflow/4616784 to your computer and use it in GitHub Desktop.
Save jaseflow/4616784 to your computer and use it in GitHub Desktop.
showSourceCode: function(e) {
var html = $('.source').html();
$("<pre />", {
"html":
$("html")
.html()
.replace(/[<>]/g, function(m) { return {'<':'&lt;','>':'&gt;'}[m]})
.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>') +
'\n&lt;/html>'
}).appendTo("#source-code");
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment