Questions tagged [code-formatting]
For posts about making code appear correctly in questions, answers and their comments.
462
questions
37
votes
1
answer
361
views
Code block adjustment
One of the things I've noticed quite often is someone will present their code like this:
if( $a > 5) {
echo $foo;
// why isn't it showing today?
}
?>
People then comment and ...
5
votes
1
answer
497
views
Virus introduced in a question?
Wanted to suggest adding some security to questions and answers whenever code added. In some weird way my Avast antivirus always complains of a trojan in the following question:
https://pt....
93
votes
7
answers
2k
views
Why is there no line numbering in code sections?
Many times users paste long code and those who want to refer to a specific line refer to it by its content, which can be misleading or cumbersome if the content appears elsewhere or the line is long.
...
-5
votes
1
answer
189
views
Error message that my post has too much code
I can't ask a question with code. I get a notice that my post is full of code, and I should add more deatil. What can I do? I already have my Java code, but I cannot post it in a question.
9
votes
2
answers
591
views
Rollback an edit that skirts a SO rule?
There's a built-in check when posting a question that contains a link to jsFiddle.net that the question must also contain code. Sometimes users attempt to skirt the rule by highlighting non-code text ...
12
votes
1
answer
309
views
How to format code after item list? [duplicate]
My text contains a few item list and a code block, but I am really crazy when formatting the code, each time I try to format it, it was align to the item list, my work around was put an dot(.) between ...
21
votes
1
answer
911
views
What "theme" does Stack Overflow use for its code formatting?
I love the simplicity of the color theme that Stack Overflow uses for its code formatting. Is this an established theme or is it built custom?
Can anyone point me to a location of the color mappings ...
3
votes
1
answer
103
views
how to input my code segment in my discussion?
how to input my code in my question?
I want to input a segment of code to ask a question
but stackoverflow alway hints me that my format is not correct
but I really don't know how to make a good ...
232
votes
1
answer
65k
views
How do I format my code blocks?
How do I post text so that it is formatted as code?
What do I need to do so that my code shows up properly—not escaped or removed—when posted? And how do I get the correct syntax ...
12
votes
1
answer
142
views
Improving formatting in review, still requires 6 characters?
I was reviewing a first post by a user, and all that was needed was to format the code part as a code sample (using the '{}' button). But it still requires 6 characters to be considered an edit. How ...
168
votes
5
answers
2k
views
Could Stack Overflow support GitHub flavored markdown?
Stack Overflow already uses its own markdown extensions, and there is already overlap with GitHub Flavored Markdown. There are very few additional pieces of syntax left to bridge the gap completely.
...
49
votes
13
answers
12k
views
Cannot figure why am getting "Your post appears to contain code that is not properly formatted"
I tried changing every section in the code below (using/not using four character indentation with/without pre). I also tried removing the formatting and the line separators on the list.
Nothing helps -...