Friday, July 11, 2008

ColdFusion Code Highlighting for a blog

One thing that's keeps me amazed is that every time I need to solve something, someone somewhere already encountered that issue and most likely solved it. This is especially true for all things computer. I pretty much expect this behavior. So this proved true as I ventured to find a way to have code highlighting for my blog.

Thanks to Aaquagua!: Web Page Syntax Highlighting for ColdFusion - Brush for SyntaxHighlighter post I was able to add code highlighting. Not only he had instructions for adding SyntaxHighlighter but also added ColdFusion brush. How cool is that?

One thing I want to add though using <textarea> insted of <pre> tag worked better. When using <pre> it adds closing tags for some reason for ColdFusion tags that are not closed. Here is an example of this behavior:

<pre name="code" class="cf">







// comments
var bar = 1;
return foo+bar;



</pre>

<textarea name="code" class="cf" >

</textarea>

Turns out the above mentioned problem is dependent on a browser. IE7 seems to be fine FF2 and FF3 have an issue mentioned, and Opera blew up completely.

So use <textarea> since that seems to be working in all browsers

No comments: