Skip to content

Instantly share code, notes, and snippets.

@thefonso
Forked from vitorbal/gistembed.js
Created December 1, 2012 22:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefonso/4185683 to your computer and use it in GitHub Desktop.
Save thefonso/4185683 to your computer and use it in GitHub Desktop.
Use writeCapture to embed gists to Tumblr
$(document).ready(function() {
var prefix = "https://gist.github.com/";
$('a[href^="' + prefix + '"]').each(function(i) {
var $anchor = $(this),
$el = $("<p></p>");
$anchor.replaceWith($el);
writeCapture.html($el, '<script src="'+$anchor.text()+'.js"></scr' + 'ipt>');
$anchor.remove();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment