Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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 (Since this question is protected, this requires earning 10 reputation on this site)
  • 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:

  1. 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.");
        }
    
  2. 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 attribute class="prettyprint", or change it into something more specific, like class="lang-vb prettyprint".

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

share|improve this question
1  
Please provide an MCVE. – Kevin Jul 24 '15 at 13:41
4  
Questions about underwater basket weaving are off-topic for this site. – Kevin Jul 24 '15 at 14:42
1  
@humn instead of a rollback, you can perform an edit with the exact same contents as before your edit (title, in your case) and assuming you do it within the 5 minutes grace period, it will show only a single revision with "[Edit removed during grace period]" - instead of having two revisions. – Shadow Wizard Apr 10 at 10:12

394 Answers 394

SPOILER SPOILER WARNING

share|improve this answer
<Style>
    <bar />
</Style>
<Setter>
    <bar />
</Setter>
<foo>
    <bar />
</foo >
<foo>
    <Setter>
        <bar />
    </Setter>
</foo >
share|improve this answer

public class x { public string test() { } }

share|improve this answer

Spaces:

if (true) {
    console.log('Hello world');
}

Tabs:

if (true) {
    console.log('Hello world');
}
share|improve this answer

def self.queued Sidekiq::Stats.new.enqueued end

def self.queued
  Sidekiq::Stats.new.enqueued
end

[code] def self.queued Sidekiq::Stats.new.enqueued end [/code]

def self.queued
  Sidekiq::Stats.new.enqueued
end
def self.queued
  Sidekiq::Stats.new.enqueued
end
share|improve this answer
1  
Good to see you around Sam! :D – Shadow Wizard Jun 23 '14 at 7:25

Is VB comment syntax highlighting working?

Sub AMethod()
    'a comment
    Dim SomeCode
End Sub
'A comment
Sub AMethod()
   Dim SomeCode
End Sub

Boo that meta hides the colors :(

share|improve this answer

Testing code formatting assssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
asfasfas
gdagf
Testing code formatting assssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
asfasfas
gdagf
share|improve this answer

Duplicating Python3's print() function is easy. Make a function that takes an argument, named whatever you want, then print that argument when the function is invoked from the interpreter. Easy.

def println(stringint):
    print stringint

Here's how you'd invoke it in your interpreter with the argument.

>>> import <filename>
>>> <filename>.println("Hello, this is a test.")
Hello, this is a test.
>>> <filename>.println(12 / 2 + 6)
12

You can also invoke it like this, without having to add the filename.

>>> from <filename> import println
>>> println("Hello, this is a test.")
Hello, this is a test.
>>> println(12 / 2 + 6)
12

There you have it, a duplicate of Python3's print() function. Yay.

share|improve this answer

Testing Japanese spacing.

〇一二三四五六七八九十 <--- 1-10

 一 三 五 七 九  <--- by 2s, japanese space

一 三 五 七 九  <--- by 2s, western space

ひらがなカタカナ漢字単語

 らがな タカナ 字単語

share|improve this answer
  1. List item

    Code block 
    
  2. Second list item, which unfortunately doesn't look like it's second which now looks like it's second

share|improve this answer

This is some text above a h1.

This is a h1

This is some text under a h1.

This is some text above a h2.

This is a h2

This is some text under a h2.

This is some text above a h3

This is a h3

This is some text under a h3.

share|improve this answer

Testing @@ServerName for errors

share|improve this answer

Links support URIs without scheme and hostname.

What is on topic here?

What is [on topic](/help/on-topic) here?

But relative URIs are not OK.

What have you tried comment

[What have you tried comment](#comment772983_3122)

share|improve this answer

Experiment on behavior of hard tabs in the answer box.

Indented with "format code" button:

int main(void)
{
    do_this();
    do_that();
    if (condition)
        do_other();
    return 0;
}

Indented manually, adjusting only the lines that "belong" at the left edge:

int main(void)
{
do_this();
do_that();
if (condition)
    do_other();
return 0;
}

Both look exactly the same in the editing <textarea>, in a browser that doesn't support -moz-tab-size:4.

share|improve this answer

✓ Unicode works in a Heading

  • ✓ Bullet works in a Heading

Multiple bullets with visible and invisible text

      • -These are bullets
      • -
  • Bullet like this too


  • 1. Blockquote your bullets

  • kbd did not break the bullets

    equal symbol below this text made it bold

    • no more blockquote bullet

Some more experiments:

  • ✓ In Bullets, it works

      • ✓ Bullet inside bullet works
      • ✓ Bullet inside bullet works (numbers are auto-adjusted)
      • ✓ Bullet inside bullet works
      • Sub bullet works
    1. Sub-bullet doesn't break the auto-numbering
    2. One more bullet

      1. Empty dash below this makes it bold

share|improve this answer

{{Infobox file format | name = | icon = | iconcaption = | icon_size = | screenshot = | screenshot_size = | caption = | extension = | mime = | type code = | uniform type = | conforms to = | magic = | developer = | released = | latest release version = | latest release date = | genre = | container for = | contained by = | extended from = | extended to = | standard = | free = | url = }}

share|improve this answer

If the code block contains html entities then those are parsed and displayed instead of displaying the plain value.

The below code block contains &#0; as the input value, but instead of displaying it as it is the parsed text is displayed like �

$('body').html($('<input />', {
    id: "myInput",
    type: "text",
    value: "�"
}));
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

Source: Appending a new Input textbox DOM to HTML body using jquery

share|improve this answer

Page 1 of 904625697166532776746648320380374280100293470930272690489102837043110636675

share|improve this answer
#include <iostream>
#include <string>
#include <vector>

template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec)
{
    for (auto& el : vec)
    {
        os << el << ' ';
    }
    return os; // emphasized
}

"string literal"
std::string s = "std::string"
'\n'
share|improve this answer

This is probably not the intended use of this tag since Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

share|improve this answer

This is a test of mixed tabs and spaces.

This line starts with four spaces.
This line starts with a tab.
    This line starts with four spaces and is indented with a tab.
    This line starts with a tab and is indented with four spaces.
    This line starts with four spaces and is indented with four spaces.
    This line starts with a tab and is indented with a tab.

aaa

share|improve this answer

Testing to see if broken bold markdown fails the same way it does in chat:

行こうかどうしようか = 行こうか**??か**

「許さない、(許さないのは)絶対にだ!」 → 「 許さない、絶対にだ!」

share|improve this answer

Normal, plain t'xt with "varying" punctuation marks.
Code highlighted t'xt with "varying" punctuation marks.

share|improve this answer

Test: Unicode characters:

Unicorn: 🦄

share|improve this answer

[meta-tag:anything-without,punctuation]

share|improve this answer

Heading 1

Testing

Heading 2

Testing

Heading 3

Heading 3 (actually just regular bold text, for comparison to the Heading 3 style)

share|improve this answer

List of canonical questions from the main site (for closing questions as dupes). These are mostly the ones I use (and putting them in my Formatting Sandbox post just makes it easier to go back to)

Java:

C:

One thing that I want to add later: something related to "what every programmer should know about floating point" to both languages.

share|improve this answer

You must log in to answer this question.

protected by Oded Nov 17 '14 at 15:36

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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