Skip to main content

Questions tagged [code-formatting]

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

3 votes
2 answers
122 views

Requesting clarification on reason for edit rejection

I recently submitted this edit suggestion: https://stackoverflow.com/review/suggested-edits/36801118 It seemed to me to be pretty straightforward. As the name of a system file, /etc/sysctl.conf should ...
AJM's user avatar
  • 1,822
1 vote
0 answers
90 views

Discussions garbles code [duplicate]

I am trying to respond to a Discussion (pushed upon us by the frustrating comment experiment), and it eats my code. I want to put this code there: # 2. Identify peaks ---- peaks_info <- cardidates::...
Axeman's user avatar
  • 35.5k
19 votes
0 answers
160 views

Creating a code block in Staging Ground includes one additional character after the text selection

When you edit a question in the Staging Ground to convert a text selection into a multiline code block by using the "Code block" button (or pressing CTRL-M), a code block will be entered ...
Progman's user avatar
  • 19.7k
3 votes
2 answers
190 views

Why does this code block have weird formatting?

COMMAND and OUTPUT is formatted as italics in this post. I know <pre><code> can be used to format text in code blocks, but that answer uses just a normal code fence ``` ```. Here's the ...
phuclv's user avatar
  • 42.4k
12 votes
1 answer
194 views

Indent/dedent in the Stacks Editor

I would love to have an indent and dedent keys in the new Stacks Editor. This has already been requested for the old markdown editor, but the request seems to have been ignored, and it seems like the ...
Anerdw's user avatar
  • 2,167
29 votes
3 answers
607 views

What causes single backticks on every line of code?

There is an issue where code blocks contain single backticks around every single line, rather than triple fences around the entire code block. This destroys the formatting. An example can be seen in ...
Adriaan's user avatar
  • 18.2k
7 votes
2 answers
391 views

How to fix the error "your post appears to contain code that is not properly formatted as code"

How do I fix the below format? I keep getting the error: "Your post appears to contain code that is not properly formatted as code." My code is indented 4 spaces and is between '''codeblock ...
Craig's user avatar
  • 21
4 votes
1 answer
431 views

Font in code blocks [duplicate]

Has the font in code blocks changed recently? Is this intended? Being exclusively active in the r tag, I'm very irritated by the distracting misalignment of < and -, which together are the ...
Roland's user avatar
  • 133k
17 votes
0 answers
145 views

Can the New Question wizard check for multiline code inside single backticks?

Every day I fix up numerous questions that have multi-line code blocks enclosed in single backticks rather than triple backtick code fences. Or they don't put a newline between the triple backticks ...
Barmar's user avatar
  • 784k
6 votes
1 answer
105 views

code formatting lost after edit, revert would not fix it

I made an edit to this answer, (changed "unicode" to "str") however when I saved the edit, the code formatting was lost. I quickly reverted the edit, however the code formatting ...
dangelsaurus's user avatar
  • 7,582
-20 votes
2 answers
477 views

When is it OK to upload images of code/data/errors? [duplicate]

When is it OK to upload images of code/data/errors? – If your answer is never, can we please talk about it? Don't get me wrong. I don't endorse uploading code/text in an image instead of uploading ...
Henke's user avatar
  • 5,839
5 votes
0 answers
158 views

Are code fences officially preferred yet? User found error message saying otherwise!

I found a question on SO where the asker had been presented with an "error" message: Oops! Your edit couldn't be submitted because: Your post appears to contain code that is not properly ...
Andrew Morton's user avatar
3 votes
1 answer
905 views

My post "appears to contain code that is not properly formatted as code", but I did wrap code in <pre><code> tags [duplicate]

I was trying to answer a coding question in JavaScript. I had some code and used <pre><code>, put my code in, then typed </pre></code>. I then came across this error when ...
Simon Sichilima4597's user avatar
1 vote
1 answer
214 views

'Code zoom' feature to view code in expanded popup [duplicate]

Right now, viewing code on Stack Overflow is quite inconvenient as it's displayed in a small text box where lines don't wrap. I hope a "code zoom" feature can be added - similar to the one ...
Leo Braun's user avatar
  • 324
15 votes
1 answer
603 views

Code blocks surrounded by triple backtick then single backtick

Off the back of Code blocks surrounded by single backtick then triple backticks, it looks like the original problem was not exactly resolved, but more reversed. I'm seeing a lot of questions come ...
Phil's user avatar
  • 165k

15 30 50 per page
1
2 3 4 5
33