-
-
Save Shagshag/c9cdb058677b021d2e30bb8d0bdce2c8 to your computer and use it in GitHub Desktop.
Tumblr gist insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$("a[href]").each( | |
function(index, element) { | |
if ( $(element).text().indexOf('gist.github.com') > 0 ) { | |
var divElement = $('<div></div>'); | |
$(element).after(divElement); | |
writeCapture.html(divElement, '<script src="'+$(element).text()+'.js"></'+'script>'); | |
$(element).remove(); | |
} | |
} | |
); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was just what I needed, thanks!
I even blogged about it, embedding your gist in a post about how I embed code in my posts (inception): https://brain.369.dk/post/173950942357/embedding-a-github-gist-in-a-tumblr-post