Questions tagged [code-formatting]
For posts about making code appear correctly in questions, answers and their comments.
495 questions
-10
votes
0
answers
99
views
How do I format code? [duplicate]
How do I format code so that it appears with all the indents and everything--as you can't go to the line without posting--and so that it turns shaded in grey?
10
votes
0
answers
172
views
Incorrectly inferred languages with new code block design [duplicate]
I came across this question where the main code block was plainly go code which had been incorrectly inferred to be coffeescript! A second block of error output was labelled as Go code. This makes ...
47
votes
2
answers
467
views
New code block design guesses incorrectly at what the language is, even when explicitly stated
(Cross-posted as a bug report to MSE which lists all affected languages found thus far. Please go there to see if a language you've observed being labeled incorrectly is included in the table)
I just ...
2
votes
1
answer
181
views
Proper syntax highlighting for Blazor - C# with HTML on Stack Overflow
The code highlighting here on Stack Overflow appears to be missing a tag for Blazor-like pages where C# and HTML are combined within the same file.
Currently, I can only format it as either C# or HTML....
0
votes
0
answers
49
views
Comment with backticks loses formatting when edited [duplicate]
With the recent UI change, a comment that was written using backticks (inline code), loses those when edited.
4
votes
2
answers
161
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 ...
1
vote
0
answers
105
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::...
19
votes
0
answers
178
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 ...
3
votes
2
answers
225
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 ...
12
votes
1
answer
215
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 ...
29
votes
3
answers
672
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 ...
8
votes
2
answers
415
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
489
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
159
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
124
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 ...