Based on http://wordpress.org/plugins/wp-syntax/ with some improvements