For questions about making code appear correctly in questions, answers and comments.

learn more… | top users | synonyms

1
vote
1answer
55 views

Cannot understand how the Ctrl+K works in Stack Overflow. [duplicate]

How does the code formatting work with Ctrl + K? I am new to Stack Overflow. I can't get it with Ctrl + K. I have to press space button for 4 times in each line I post.
0
votes
2answers
66 views

Should I edit a code in order to respect code conventions?

Apart from obvious cases such as a lack of indentation, should we edit a question to fix a code that does not respect a code convention? In Python for instance, we have a clear Style Guide ...
2
votes
0answers
35 views

Code-formatting error occurs when composing post on Stack Overflow

Code formatting error occurs when I tried to post a question on Stack Overflow. Error message Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 ...
8
votes
3answers
108 views

How to easily unindent a block of code?

When editing a post, sometimes the code block has been indented too far and it forces a horizontal scrollbar unnecessarily. Is there a quick way to correct this type of indentation or do I still have ...
1
vote
1answer
46 views

How to indent long code in question or answer? [duplicate]

Suppose I had to post 400 lines of code then will I have to indent all those lines by four spaces one by one or is there any other way ?
3
votes
1answer
28 views

Code snippet formatting don't work after bulleted list formatted line [duplicate]

I have problem when answering or asking questions on StackOverflow Suppose I have two possible code snippets and I want to ask which is better. Here is code 1: @Override protected void ...
0
votes
1answer
18 views

formatting code after numeric list doesn't display properly [duplicate]

So I've just edited a question and noticed that if I enter a code block after a numeric list: in Addbill form the User insert items to the the DB(NewBill Table). in Bill form is a reportview ...
1
vote
2answers
43 views

how to make a block of selected text become code [duplicate]

Is there a way to drag my mouse over some text to select it and then press a button to have it get spaced in 4 spaces so I don't have to manually do it over long blocks of text. It has become ...
-3
votes
1answer
84 views

Formatting Steps

I find steps easier to read if formatted as code. For post that contains a substantial amount of pseudo code, should this be formatted as code? How about questions that contain steps? Here is an ...
0
votes
1answer
53 views

Cannot format as code

The "format as code" button is not working properly when I attempt to format the stack trace in this question as code. Whenever I try to format it, nothing happens. What is the problem?
0
votes
2answers
105 views

Why SO recently began removing formatting whitespace within code blocks?

Recently I've noticed that formatting whitespace in code blocks appears to be removed: line1 - next line is prepended by six spaces line2 supposed to be indented but isn't which the graphic ...
1
vote
0answers
51 views

Wrap Text Possible? [duplicate]

Here is some code: #!/bin/bash export PATH=$PATH:/home/aneesh/adt-bundle-linux/sdk/tools export PATH=$PATH:/home/aneesh/adt-bundle-linux/sdk/platform-tools declare -a ...
7
votes
1answer
27 views

“Quote” button breaks formatting

I was editing this question on russian.SE where the OP was asking about the meaning of a Russian poem. As the poem itself wasn't formatted properly, I wanted to fix the line breaks to make it easier ...
-3
votes
2answers
76 views

How about auto-identing code fragments (at least in questions) based on the first found language tag? [duplicate]

Lately, I've seen lots of homework questions or of "first postings" for more professional help with really poor editing quality. This is understandable and usually you can let it go and rework it ...
5
votes
3answers
86 views

Is it appropriate to comment on and base votes on coding practices?

Where answers are technically correct but are (in my opinion) examples of bad coding practice (for example the multiline-braceless-if in C and related languages) I tend to comment upon them and if ...
10
votes
2answers
228 views

Why do people make really trivial syntax edits in questions?

This question especially applies to questions which query syntax errors I've noticed an increasing number of edits by people changing syntax in questions to remove extraneous syntax. Edits are ...
1
vote
0answers
15 views

Using inline code formatting [duplicate]

Shouldn't inline formatting be used only for code? Recently a lot of people apply it to non-code blocks like: Frameworks: Bootstrap, Backbone.js, AngularJS ... UI elements, when a user says logout ...
0
votes
2answers
57 views

How to put tab within code section?

How could I put Tab in order to format the code ? (same as press 4 time "space") For example in the follow pic I want the put tab in the 2nd line (the 1st line made by spaces)-
-12
votes
2answers
97 views

Make the system keep suggested edits away from code blocks

As a >2k user on SO, I often review suggested edits. If an edit formats code, I will accept. If an edit changes code, I (along with everyone else) reject it. In fact, I've yet to see an edit that ...
1
vote
1answer
35 views

Editing question changing code to block quote is still formatted as code

I asked a question on StackOverflow and later added some more information. I included a quote initially in a code block, but then I edited the question, highlighted those two lines, and clicked the ...
1
vote
0answers
25 views

Editor button for astyle-like code formatting?

There are tons of questions where code formatting is absolutely awful and unreadable (to say the least). When I have time to do it (and when my mood is good enough, let's admit it) I run the code ...
-1
votes
1answer
69 views

Code Formatting in Two Consecutive Lines

What I see as an issue: A lot of times when I read and write code in StackOverflow I run into the following scenario: Here is some Code and words. This is more random wody stuff, some code ...
1
vote
0answers
58 views

My question on indentation in Emacs does not meet Quality Standards [closed]

Can someone please help me modify my question so as to meet the quality standards? I spent more then 15 minutes writing it. After initial rejection I suspected it might be because I am pasting code ...
2
votes
1answer
79 views

VB.NET tag needs to have ‘lang-vb.net’ syntax highlighter set as default

When I manually specify the language of a code block as VB.NET like this: <!-- language: vbnet --> theNodeList.Cast(Of XmlNode)() theNodeList.Cast(Of XmlNode)() the code is not ...
0
votes
2answers
43 views

How to fix this coloring problem? [duplicate]

I have a question that have 5 tags, and c is not one of them. Without c tag, the code block is colorless and harder to read. Other 5 tags are way more important than c tag, therefore I cannot replace ...
3
votes
0answers
46 views

Blockquote when code sample makes one-line code difficult to read?

Just saw a question in which the OP indicates a code in plain text: find /opt/backup/test -name "*.gz" -exec smbclient -A /opt/backup/smbclient_authentication.txt //1.1.1.1/test -c put '{}' \ I ...
1
vote
1answer
36 views

How should it be handled when editing a question with extra code

While trying to format large blocks of code I often find extra code at the end of a code block. This could mean the user just cut too much code or is missing some code. How should this be handled ...
-1
votes
1answer
83 views

Option to flag code from mobile as needing formatting

Sometimes, I do some short code extracts when I'm typing an answer in the mobile site. However, getting code formatting on a mobile is HELL, as double space means full stop followed by space, which is ...
-8
votes
1answer
161 views

Should Stackexchange switch to ACE Editor?

There is an Open Source code editor called ACE. It is used in Github gist right now. One feature they have that I love is box shaped text selection. (ALT+Click drag to use) This is hyper-useful ...
-4
votes
1answer
74 views

Add code blocks to alternate image text

I often find the need to post an image in an answer to help summarize my point. I have used these before to demonstrate things such as CSS properties, as shown in this answer. I added the code that ...
0
votes
0answers
38 views

Formatting for Comments

Every once in a while, I need to put a bit of code in one of my comments, and to do so, I have to pretend that I'm going to write an answer just to copy the backtick to paste it into my comment (I'm ...
1
vote
2answers
42 views

Backquotes inside backquoted code in comments

Sometimes, when I write answers, I need to include backquotes as part of the code (not as formatting markup). This I can do by using four-spaced indent in the answer. However I can't find a way to ...
1
vote
2answers
93 views

Code block is not changing colour [duplicate]

I was trying to edit this question but I could not edit the code block using the normal Ctrl+K method. The code would not format properly, it stayed clumped together even after I applied Ctrl+K. So I ...
18
votes
0answers
143 views

Don't consider inline code spans as code for the purposes of the quality filter

From my earlier question, Detect attempts at disguising meaningless text as code blocks: Currently, the quality filter only asks that you have a code block before it will accept your submission of ...
2
votes
2answers
59 views

Why don't these equations display as code formatting?

In this question: Formatting a txt file of equations into the same format and then manipulating them for linear algebra calculations in Python The three lines from the 'txt' file with three ...
2
votes
1answer
54 views

left angle bracket in pre tag explodes formatter

I was trying to move the text in between the tables out of the code block in this question, but the preview refused. I have a table that has ID and ParentId, I would like display each ID with its ...
0
votes
0answers
21 views

Why is code pasted in one place formats correctly and pasted toward the bottom does not? [duplicate]

Here's a response I posted on SO. Notice that the code, when placed at the top, formats correctly, but when placed towards the bottom, does not.. (Seems like the formatting code does not sanitize ...
7
votes
1answer
103 views

Do backticks count as code for jsFiddle links?

According to Kevin's answer to Prevent posts with links to jsfiddle and no code: ... if you try and post to Stack Overflow with a link to either jsfiddle.net or ideone.com you'll be required to ...
4
votes
1answer
97 views

Single code formatted space ` ` works in questions and answers but not comments [duplicate]

It's annoying that on stack overflow ` ` works fine in questions and answers but not in comments, to produce a single code-formatted space. Edit a few days later Actually my question appears to be a ...
12
votes
2answers
152 views

Enable tab and shift + tab for code formatting

After some discussion on this question I decided to make a feature-request (or at least a discussion about it). It would be very nice to be able to use Tab and Shift+Tab to move code blocks (like in ...
1
vote
1answer
87 views

How do I move a code block to the left on SO? [duplicate]

Just wondering: Is there a key-combination for moving code blocks left (inverted tab)? shift+ tab doesn't seem to work.
1
vote
1answer
50 views

Triple backquote for code snippets [duplicate]

I find the 4 space indentation to include code snippets unnecessarily difficult to use. Typically, when you copy and paste some code it requires manually reformatting each line (unless there's some ...
-1
votes
2answers
66 views

What is the proper way to format a posts in Stack Overflow? [duplicate]

I have been using Stack Overflow for quite a while now and have edited lots of post. Each time I edit a post, I end up formatting the code parts by pressing space 4 times so that it formats the codes ...
1
vote
1answer
41 views

Formatting Returned Errors on Stack Overflow Questions

How should one format returned errors or console messages in a question on Stack Overflow? Recently I ran into a PHP question that had an error as a code block: PHP Warning: ...
6
votes
1answer
125 views

What is Wrong with Code Formatting

All, I have noticed that all the code formatting for questions or answers new or old is 'flat'. That is all indentation of the code is gone even when the code has the required four-spaces allocated at ...
6
votes
1answer
121 views

Xcode-snippets make code look like its inside a comment

When asking questions on SO that involve Xcode code-snippets, the syntax is to use a #, which makes the code look like it's inside a comment. For example this Xcode standard snippet for looping ...
-1
votes
1answer
101 views

Could angle brackets be escaped for everything not on a permitted HTML tag whitelist? [duplicate]

In this question, I noticed that the code I had pasted in a <pre> (should I really be going through the manual labor to indent four lines) wasn't displaying crucial parts of the raw source. ...
2
votes
1answer
59 views

how do i format code in comments?

I added a comment to the top answer here but couldn't get the code to format correctly. I made sure I was entering the 4 spaces. The comment was only editable for 5 minutes and it now appears to ...
10
votes
3answers
114 views

How to post comment with multiple spaces in it?

I know how to do that in question or answer post. But how do I write a comment post which contains multiple spaces? I want to write this in a comment: print ("string") I tried: Using ``, but ...
2
votes
0answers
67 views

Code block prefix text, like `visible`

Recently I have repeatedly encountered a bug with the Markdown code block button. I’d usually select some block of code and click the button to make it indent by 4 characters and everything works. ...

1 2 3 4 5 8