jQuery Chili plus Code Autoescape is good code highlighting in WordPress

Today I found Chili which is a jQuery plugin. I’ve been looking for something like this for quite some time. The ability to highlight code snippets client side is a very appealing thought. No more server side manipulation that might be prone to errors, follow the link to Priyadi’s autoescape plugin below for a more thorough discussion.

Currently I’m using Code Autoescape to separate my snippets from the rest of the HTML. That plugin doesn’t do highlighting though, but making Code Autoescape work with Chili was not very difficult, I just removed all the provisions Priyadi had done for Geshi and changed “lang” to “class” in a few places.

Download modified Code Autoescape.

Here are a few examples:


function showMainPic(pic){ 
	var inner_html = '<img src="'+galleryDir+pic+'"/>'; 
	var scroll_to = $("#mainPic").position(); 
	$.scrollTo(scroll_to.top + ( $("#mainPic").height() / 2 ), {speed:500}); 


<table cellpadding="10" border="0" cellspacing="0">
    <td width="10px">

    <td valign="top">
      	<li><a href='http://www.prodevtips.com/2007/12/' title='December 2007'>December 2007</a></li>
	<li><a href='http://www.prodevtips.com/2007/11/' title='November 2007'>November 2007</a></li>
	<li><a href='http://www.prodevtips.com/2007/10/' title='October 2007'>October 2007</a></li>


function loadController($controller){ 
    $class_name = ucfirst($controller)."Controller"; 
    $file_name = "controllers/".$class_name.".php"; 
    $ctrl = new $class_name; 
    return $ctrl; 


CREATE TABLE `db_checkup_item` (
  `id` bigint(12) NOT NULL auto_increment,
  `value` varchar(250) NOT NULL,
  UNIQUE KEY `id` (`id`)

Related Posts

Tags: , , , ,