Syntax Highlighting

This blog uses the WP-Syntax plugin to support syntax highlighting for a number of languages, including PHP. You can use this in comments, as well. To post a code snippet in a comment, wrap it in pre tags:

Comment comment comment, comment. Comment:
 
<pre lang="php">
<?php
$foo = bar("delicious cake");
/* ... */
?>
</pre>
 
Comment comment?

The resulting comment would look like


Comment comment comment, comment. Comment:

<?php
$foo = bar("delicious cake");
/* ... */
?>

Comment comment?


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped=""> (Syntax highlighting)