Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tumblr gist insert
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script type="text/javascript">
$(function() {
$("a[href]").each(
function(index, element) {
if ( $(element).attr('href').indexOf('gist.github.com') > 0 ) {
var divElement = $('<div></div>');
$(element).after(divElement);
writeCapture.html(divElement, '<script src="'+$(element).attr('href')+'.js"></'+'script>');
$(element).remove();
}
}
);
});
</script>
@tryvin

This comment has been minimized.

Copy link
Owner Author

tryvin commented Nov 1, 2015

Use this so you can use the Rich text editor from Tumblr, all the other codes I saw needed to create a div element, this one just goes throw all a elements, and if it has gist.github.com on the url, it inserts the element!

@keitaito

This comment has been minimized.

Copy link

keitaito commented Mar 6, 2016

Where should I put this code? Within the header tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.