As per Jeff's suggestion in this comment:
You can use this question as a formatting sandbox. You can
- post any answers to this question
- post comments to this question or its answers
- test suspected bugs with the editor
Beware that since the changes to syntax highlighting in December 2010, and the inline hints added March 2011, no syntax highlighting is applied unless the question's tags or an inline hint enable it. So, to test highlighting here in the sandbox:
On the start of a line, specify a language inline using
<!-- language: lang -->
hints, and indent the code 4 spaces as usual. There is a full list of hints (scroll down a little).<!-- language: lang-html --> While not hinted otherwise: <html></html> source <b>goes</b> "here". <!-- language: lang-js --> var a = 3; while (not (a > 0)) { alert("JavaScript code <b>goes</b> here."); }
Or:
Save your post.
Use something like Firebug (Firefox), Web Inspector (Safari, Chrome) or Developer Tools (Internet Explorer 8) to edit the resulting HTML. To open Chrome Dev Tools, press F12
Find the
<pre>
element and add the attributeclass="prettyprint"
, or change it into something more specific, likeclass="lang-vb prettyprint"
.Run the following in the location bar:
javascript:prettyPrint();