Stoyan Stefanov shared with us his new hack to highlight source code with Text_Highlight rendered in JSON. His class based on HTML renderer, return JSON data instead of HTML. Now you can exchange JSON highlighted code on your AJAX application and display it directly via the JSON renderer for Text_Highlight.

Text_Highlighter is one of my favourite PEAR packages, seems like I’m addicted to highlighting source code. After adding BB code and simple HTML renderers and an ABAP code syntax definition, today I played with adding a JSON renderer. Useful in case you want to get highlighted source code in your new shiny AJAX app.