I recently switched to using Markdown as my default editor for Tumblr. The nice thing about using the Markdown editor is that Tumblr will recognize a code-block and surround it with <pre> tags.
You won’t get syntax-highlighting however, which is where Google Prettify comes in.
Just add the following static assets:
And then add the following line:
This line of code will wait until the DOM is ready before adding the prettyprint class to all pre tags. Then it will execute prettyPrint().
I highly recommend hosting the Prettify CSS/JS elsewhere, because code.google.com serves these files without Gzip compression.