Note: Answers will occasionally be moved to the Sandbox archive when there are too many of them. When using them to report bugs, keep an eye.

As per Jeff's suggestion in this comment:

You can use this question as a formatting sandbox. You can:

  • edit this question itself (Community Wiki questions such as this one require 100 reputation to edit)
  • post answers to this question (This question might be protected, requiring earning 10 reputation on this site to answer)
  • post comments to this question or its answers
  • test suspected bugs with the editor or the rendering
  • post ponies (only when mods are asleep)

Beware that since the changes to syntax highlighting in December 2010, and the inline hints added in 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:

  1. As of January 8, 2019, you can use GitHub-flavor fenced code blocks in your posts, specifying the language after the opening fence:

    While not hinted otherwise: <html></html> source <b>goes</b> "here".
    var a = 3;
    while (not (a > 0)) {
        alert("JavaScript code <b>goes</b> here.");
  2. (The traditional way) 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.");
  3. Or:

    • Create code blcks in either way (see above).

    • 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 Developer Tools, press F12

    • Find the <pre> element and add the attribute class="prettyprint", or change it into one of the valid syntax hints linked above, like class="lang-vb prettyprint".

    • Run the following in the location bar: javascript:prettyPrint(); or prettyPrint() in the console.

Answers that are considered annoying or obnoxious, or that cause breakage for users, will be deleted. This is codified as a policy as of March 29, 2018.

  • Bold code block.Italic code block. – smileycreations15 Mar 4 at 12:36
  • Is new line working correct? Adding two spaces at the end of this line And now the new line... And another another... No new lines :( – smajli Mar 5 at 11:14
  • New line </br> continue in new line... – smajli Mar 5 at 11:16
  • Do HTML &quot; entities &quot; work&nbsp;? Guess not. – a wizard arachnid Apr 1 at 22:18
  • 1
    A comment with some weird markdown, to test and help this user. Look tags work too, and so does tour. – Bhargav Rao Apr 6 at 1:59
  • Note: Do not remove @BhargavRao's comment, or you will break this answer – wizzwizz4 Apr 6 at 17:16
  • @BhargavRao When sandbox answers are moved to the archive, comments such as this one -- on the question itself -- aren't migrated; they're deleted. – rgettman Apr 9 at 19:37
  • @rgettman, yeah, that is fine. I had used it for just a small demonstration. The linked answer itself is self-sufficient. Thanks anyway. – Bhargav Rao Apr 9 at 20:22
  • @BringBackThePolyglot Do you get notifications if I reply to your comment and then delete your comment before you visit the site? (for those wondering how I can single-handedly delete someone else's comment, comments containing "thanks" are automatically deleted as soon as someone flags them) – Donald Duck Apr 25 at 16:32
  • @DonaldDuck Yes, I got notified. – Bring Back The Polyglot Apr 25 at 16:32
  • honestly the over 500 hundred upvotes for a sandbox post is taking this real time satire thing you guess do with rep points too far – Adam May 7 at 11:14
  • It makes me feel like doing one too like an onion announcing the Debian contributor community have been assigned complete authority and trust over all encryption matters for the central banks of the world but no, im an adult, I can show restrain – Adam May 7 at 11:16
  • thanks thanks thanks – Adam May 7 at 11:17
  • no I'm seriously asking now, what does op mean when someone causes a user "breakage"? is that like the time I was not allowed to take the archer profile pic down for like 6 months? that did break me tbh – Adam May 7 at 11:22

19 Answers 19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .