If you want to toy with white-spaces, tabs, linefeed and carriage-return, how do you "select them" in javascript?
x = $('pre').html().replace(/(\r\n|\n|\r)/gm, "#");
edit : ^Does not work for linefeed and carriage-return.
Now, tabs are /(\t)/ and spaces are /( )/.