Skip to main content

Questions tagged [code-formatting]

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

37 votes
2 answers
305 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 ...
TylerH's user avatar
  • 21.3k
2 votes
1 answer
176 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....
FlorianD's user avatar
  • 115
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.
Abhijit Sarkar's user avatar
4 votes
2 answers
158 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,860
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::...
Axeman's user avatar
  • 35.7k
19 votes
0 answers
177 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
  • 20.1k
3 votes
2 answers
221 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
  • 43.1k
12 votes
1 answer
211 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,775
29 votes
3 answers
661 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
410 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
  • 23
4 votes
1 answer
486 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
  • 134k
17 votes
0 answers
156 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
  • 789k
6 votes
1 answer
122 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,602
-21 votes
2 answers
572 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,897
5 votes
0 answers
165 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

15 30 50 per page
1
2 3 4 5
33