I'm using stand-alone highlighting (not the editor), something like this: http://codemirror.net/demo/runmode.html
How can I auto-detect the language to use when running the highlighter?
There's a mode-autochanging demo here: http://codemirror.net/demo/changemode.html
But I don't know how could I adapt this to work with Codemirror.runMode(). I wish to highlight the entire code block using the auto-detected scheme.