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 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
# Tags treated as block tags only if the opening tag is alone on it’s line:
var $context_block_tags = ’script|noscript|math|ins|del’;
to read
# Tags treated as block tags only if the opening tag is alone on it’s line:
var $context_block_tags = ’script|noscript|math|ins|del|source’;
next, in the syntax plugin, all occurrences of [source: are replaced by < source lang=.
yesterday i updated the wordpress plugins on our d2h.net and xyzzyxyzzy.net blogs. once done, both blogs would not work anymore…duh! the updated geopress plugin was borked — or so it seemed…
…it turned out that i had added code to the earlier version of geopress to do pretty printing of coordinates, and, of course, the update flushed that code down the drain. thanks to a regular backup running on our web server, however, that code was not gone forever. here are the functions that i added:
takes geopress’s the_coord() and pretty-prints it as human readable “old-style” latitute–longitude coordinates. the_geo_coord_esc() finally, produces a URL escaped longitude–latitude coordinate for use inside a, well, URL: