You can download the plugin from http://wordpress.org/extend/plugins/wp-syntax/. And it supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.
But it’s not very convenient to use it, when edit a post, I must use the ‘html view’ mode, and add
1 2 3 4 5 6 7 | <div id="foo"> <?php function foo() { echo "Hello World!n"; } ?> </div> |
1 2 3 4 5 | public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } } |
1 2 3 4 5 | class Example def example(arg1) return "Hello: " + arg1.to_s end end |