January 3, 2008
filed mid-afternoon by DrScofield in: hacking, research
QR code for this entry · average time to read 0:32 minutes

SyntaxHighlighter is quite a nice wordpress plugin that provides syntax highlighting for a range of programming languages (among them my favorites python & C#). the problem is, in its original unadulterated form it doesn't play with my favorite markup plugin php markdown extra at all :-(

after quite a bit of hacking, it transpires that one can make them play nicely with one another. the idea that i pursued was to change the [source:XXX] tag to < source lang=XXX> and have php markdown treat it the same as the < pre> tag.1

getting markdown extra to recognize the < source> tag is fairly easy2, i needed to change to read

next, in the syntax plugin, all occurrences of [source: are replaced by < source lang=.

i've created ZIP files of the modified SyntaxHighlighter and Markdown Extra plugins, share and enjoy.


  1. to prevent any of the parsers from jumping on the tags, i've inserted a space between '<' and the tag name. 

  2. ...once you figure it out, that is. 

all content posted on these pages is an expression of my own mind. my employer is welcome to share these opinions but then again he might not want to.

no Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment