Sunday, November 22, 2009

Setting up SyntaxHighlighter version 2.x on Blogger

I ran into a couple snags when setting up SyntaxHighlighter on Blogger. You should be aware that there are major changes to the SyntaxHighlighter API between version 1.x and version 2.x. Since many of the tutorials floating around do not specify which version they're for, it can be a little frustrating to set up.

  1. I downloaded version 2 from the author's website.
  2. Followed the instructions here: http://spenthil.com/2009/04/12/syntaxhighlighter-2-0-on-blogger/
  3. Done!

And here's what it looks like:

<?php
echo 'This is a test!';
?>

P.S. One thing to keep in mind when following the instructions is that if you turn off Blogger's automatic line break conversion (line breaks become <br/>), your existing posts will lose their line breaks. I had to go back and put explicit <p> and </p> tags around each of my paragraphs in my posts.

No comments:

Post a Comment