Here’s a quick tip. I wanted to create a document that contained code snippets and used Prism for the code highlighting. To do that easily, I needed all the pre > code tags to have their contents converted from actual code (that the browser will use to render) into text (so the tags show).

For this site I use a plugin that takes care of this, however, for a standard document I used a snippet of jQuery (this assumes that your code is wrapped in a pre and code):


$(document).ready(function() {
    $('code').each(function() {
        $(this).text($(this).html());
    });
});