Skip to main content

Questions tagged [code-formatting]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
166 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
155 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,838
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
175 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
218 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
  • 43k
12 votes
1 answer
209 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,767
29 votes
3 answers
650 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
409 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
482 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
153 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
  • 788k
6 votes
1 answer
121 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
-20 votes
2 answers
560 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
3 votes
1 answer
930 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

15 30 50 per page
1
2 3 4 5
33
Morty Proxy This is a proxified and sanitized view of the page, visit original site.