How to embed gist snippets using Tumblr markdown

markdowntumblr

I post using Tumblr's markdown support. I've tried embedding my gist snippets as links, etc. but can't seem to figure out the right combination. If I post using html, the gist links work fine. I would rather use markdown, how can I do this?

Updated with examples

I tried it with a basic embedded script tag, which didn't produce anything.

<script src="https://gist.github.com/1256020.js?file=gistfile1.rb"></script>

I also tried it with a reference to the script tag

[gist][1] 
.
.
.
[1][<script src="https://gist.github.com/1256020.js?file=gistfile1.rb"></script>]

I also tried other variations of embedding the hyperlink but nothing would show up on the page.

Best Answer

It seems the real problem lies in the fact that embedded scripts are ignored in posts, most likely for security issues.

But it is possible to load JS within the description field when you go to "Customize your blog" (Kind of defeats the previous statement)

So you may be able to use a JS library (I think Write Capture might help) that allows you to write Javascript to specific parts of the document and use a parser to search and replace for phrases for example

[gist 1256020]
<div class="gistr">1256020</div>

Then you use a parser to deal with it. Or wrap Gist IDs in div element with say a class, iterate through all elements with that class and replace the id with the Gist using the Write Capture function So as you can see... it ends up going into a programming problem which is outside the scope of this site.