Questions tagged [code-formatting]
For posts about making code appear correctly in questions, answers and their comments.
485
questions
19
votes
2
answers
192
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 ...
-3
votes
0
answers
85
views
Bug in formatting code [duplicate]
Have a look at this question, in particular at my answer.
There is a for loop in the answer, which is now formatted correctly as code (each line is indented by 4 spaces).
If you look at the original ...
7
votes
2
answers
370
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 ...
4
votes
1
answer
255
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 ...
17
votes
0
answers
114
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 ...
6
votes
1
answer
91
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 ...
-22
votes
2
answers
337
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 ...
5
votes
0
answers
155
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 ...
3
votes
1
answer
768
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 ...
1
vote
1
answer
189
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 ...
15
votes
1
answer
462
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 ...
1
vote
1
answer
166
views
Correct use of code block formatting?
Is the following correct use of a code block (the curly braces icon) in a Stack Overflow question?
def __init__(self,rect_len,rect_wid,stylus_in):
self.len = rect_len
self.wid = ...
1
vote
0
answers
103
views
Indented code block italicizing text contained within asterisks
I stumbled across this question which has some peculiar formatting in the code block.
I noticed that some of the text within the code block was italicized, which I was under the impression could not ...
70
votes
2
answers
969
views
Code blocks surrounded by single backtick then triple backticks
In the past couple of days I've noticed a number of questions that have their code blocks entered like:
`
```
code
```
`
There's a line with a single backtick, then the normal triple-backtick code ...
31
votes
2
answers
495
views
Should I use inline code when mentioning a class, function, interface name? [duplicate]
I always use inline code when mentioning class, interface, and function names within my English sentences. In my opinion, this makes it better to read as it separates English words and grammar from ...