Skip to main content

Questions tagged [code-formatting]

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

Filter by
Sorted by
Tagged with
5 votes
0 answers
77 views

Stacks Editor says plain text, but code formatting isn't plain text

Stacks Editor says plain text, but code formatting isn't plain text: Screenshot taken on https://meta.stackexchange.com/ Markdown: > **To create a reviewers' Custom Max Papers after having run ...
Franck Dernoncourt's user avatar
1 vote
0 answers
38 views

Cannot paste into SE code blocks when Editing, breaks text editor and Markdown preview

There seems to be something wrong with the text editor when editing code inside ``` code blocks. I've noticed this when editing questions. Copy code from my IDE Edit a question Highlight all of the ...
pkamb's user avatar
  • 4,677
-14 votes
1 answer
184 views

Sharing code and images efficiently

Let me assume I would like to share a particular image that contains certain simplifications. I don't want to directly paste it to make the question short, simple, and straightforward. So, the best ...
KNVCSG's user avatar
  • 1
3 votes
1 answer
122 views

Post formatting is not accurate for numbered lists of code blocks. Is this a bug?

Compare the way this list looks in the post versus the screenshot of the preview: text: 1. { label: `Baz ${x ? n1 : n2}`, kind: "B", } satisfies B, 1. { label: `Baz ${x ? n1 : n2}` ...
Daniel Kaplan's user avatar
8 votes
0 answers
66 views

Formatting tips below the body textbox of a post are wrong

When posting a question or answer, there is a formatting help below the body textbox, which includes tips for how to format code, make text bold or italic, and quote text: However, the tips for ...
BeastOfCaerbannog's user avatar
2 votes
0 answers
120 views

Asking how to format code blocks on SOF because I am prohibited from commenting on an existing post

I am getting this warning when proofreading a question: Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or ...
Gideon's user avatar
  • 21
9 votes
0 answers
159 views

Colors of code-formatted text in comment help is difficult to read

The new color scheme on the collapsible help section when adding a comment is very difficult to read for the highlighted sections. The new darker highlight does not have enough contrast with the black ...
Andrew's user avatar
  • 571
6 votes
0 answers
137 views

Please support syntax highlighting in user profiles

I found a bug report about this: Code syntaxhighlighting does not work in "About Me" The answer by a staff member says: If you want to make a case for why we should, a feature request would ...
CPlus's user avatar
  • 2,611
7 votes
1 answer
133 views

Markdown errors in blog post about RAG

Editor note: While there's at least one other applicable tag, I'd like to leave it at four tags to allow for a status-* tag. In this blog post, there's an unusual use of a code block to quote LLM ...
cocomac's user avatar
  • 14.5k
4 votes
1 answer
173 views

Syntax highlighting of Makefiles

The syntax highlighting is bugged for Makefiles. As per https://meta.stackexchange.com/a/356459/1288919 I used: ```lang-makefile Current output for: https://stackoverflow.com/a/77223358/22510042 ...
Tripple Moon's user avatar
4 votes
0 answers
212 views

More fun with "Your post appears to contain code that is not properly formatted as code."

I have tried to post the following to Stack Overflow: I have a very simple HTML form embedded in an email I send to people who have subscribed to my blog so they can confirm their email addresses. ...
P. James Norris's user avatar
3 votes
0 answers
60 views

Code background can overflow comments [duplicate]

Look at this: I think that overflow is due to the following CSS rule: code { white-space: pre-wrap; } Changing it to the following seems to fix the issue: code { white-space: break-spaces; } ...
Enlico's user avatar
  • 380
4 votes
0 answers
176 views

MathJax bugs "Your post appears to contain code that is not properly formatted" [duplicate]

V1: complains $$ \frac{x}{y} $$ V2: doesn't $$\frac{x}{y}$$ V3: complains $$\begin{align} & \frac{x}{y} + \frac{y}{x} \\ & \frac{y}{x} + \frac{x}{y} \\ \end{align}$$ I favor working ...
OverLordGoldDragon's user avatar
3 votes
1 answer
82 views

Code highlighting and image placement breaks despite correct syntax

Signal Processing answer, normal vs preview: It's only toward the bottom of the post, yet it doesn't happen toward bottom of a much longer post. I confirmed it's also reproduced only with the ...
OverLordGoldDragon's user avatar
3 votes
3 answers
145 views

What tool is there for creating Stack Exchange markup language tables which do not involve typing the tables one key-stroke at a time?

The Stack Exchange (SE) network has many different websites to support the learning of natural languages. Links to some of these SE sites are provided below: German / Deutsch | Spanish / Espanol ...
Toothpick Anemone's user avatar
5 votes
0 answers
133 views

Cannot post question - 'Your post appears to contain code that is not properly formatted as code'

I am trying to post a question to Stack Overflow (and also relevant on a few other sites) but am met with the following message: Your post appears to contain code that is not properly formatted as ...
tmrgn's user avatar
  • 51
3 votes
1 answer
81 views

How can I change the Markdown of a post that was created using the "Ask Wizard"? It's formatted using 'heading' formatting

Take a look at this (badly asked) question: When I try to implement the project it fails and I get this error I tried to change the Markdown of the question since the text is enlarged and in bold: ...
MendelG's user avatar
  • 553
3 votes
0 answers
48 views

Comments with `code ticked` text with large spaces seems to leak onto other parts of the page [duplicate]

I posted a comment on Stack Overflow with the following text: @DougMaurer that command returns `Cmdlet Get-PackageProvider 1.4.8.1 PackageManagement` It ...
Timothy G.'s user avatar
  • 2,657
5 votes
0 answers
39 views

Added code not always visible as a change in the Reopen Votes review queue

Here is a Reopen Votes review queue item, where the author added some code to the question. However, that is not displayed in the 'Inline' and 'Side-by-side' tabs, which just show some grammar ...
Glorfindel's user avatar
  • 252k
12 votes
0 answers
120 views

Code block within spoiler gives different result than shown

Background: I'm using the opt-in beta for the new editor. When using the following markdown in the answer editor: >! ```python >! if True: >! print "Hello World" >! ``` It ...
mbomb007's user avatar
  • 1,184
7 votes
1 answer
145 views

Code no longer displays, despite being selectable [closed]

Since today, suddenly code no longer displays for me: The same happens for in-line code, also that in comments. However, I can select the code: and copy-paste it to a text editor. Is this a new bug? ...
Adriaan's user avatar
  • 1,396
17 votes
0 answers
190 views

Don't treat code blocks as spaces when searching

I wanted to find all the posts containing the phrase call or call. In my case, I'll demonstrate on Stack Overflow, but this happens on Stack Exchange search too, so this isn't just an Stack Overflow ...
cocomac's user avatar
  • 14.5k
7 votes
1 answer
132 views

Is the language name case sensitive for syntax highlighting?

I often use the syntax-highlighting feature of Stack Exchange in order to make my code easier to read. ```lang-python for k in range(0, 10): print(k) ``` for k in range(0, 10): print(k) ...
Toothpick Anemone's user avatar
3 votes
0 answers
219 views

Do I have to worry about patent issues for code posted on Stack Overflow?

I purposely named this question similar to Do I have to worry about copyright issues for code posted on Stack Overflow?. Since Fedora is banning CC-0 licensed source code citing issue of explicitly ...
Yao Wei's user avatar
  • 69
6 votes
2 answers
104 views

Search fails when original text includes backticks for formatting

A Stack Overflow post including the following: service1 has integration tests that needs to call the API on service2. ...or in its Markdown source: `service1` has integration tests that needs to ...
Arjan's user avatar
  • 28.2k
4 votes
0 answers
140 views

Appearance of HTML and CSS snippet is changing when it is indented

Today I was editing this question to change the formatting of its code into a runnable snippet. Once I configured the snippet, Stack Overflow would not let me submit my question because it thought ...
aplua's user avatar
  • 45
6 votes
0 answers
83 views

What are the chances of getting auto-prettier code formatting on code blocks on Stack Overflow? [duplicate]

This answer taught me that highlighting a code block and clicking the curly brackets icons auto-formats the code block. Many developers, me included, are used to the comfort of format-on-save ...
Guy's user avatar
  • 185
8 votes
2 answers
196 views

How can I find posts with particularly large code blocks in a non-code-based site?

From time to time in Space SE a question or answer about a calculation will need to share a significant amount of tabular data, say 100 or 1000 lines. It needs to be forever available to future ...
uhoh's user avatar
  • 6,396
8 votes
0 answers
79 views

Markdown reformatting is broken if a list item starts with a block element

The new/stacks editor, when switching from source mode to Markdown mode, breaks alignment of list items <li> if it begins with a block-level element (<blockquote> or <pre>). For ...
iBug says Reinstate Monica's user avatar
0 votes
0 answers
119 views

Why is my Python code not highlighted? [duplicate]

I have posted the following code in my question: import numpy as np for i in range(3): n = np.random.randint(2, 10000) m = np.random.randint(1, n) A = np.random.randn(m, n) * ((1 / m) ** ...
BinChen's user avatar
  • 119
1 vote
0 answers
159 views

Getting a code formatting error when I try to post this question on Stack Overflow

When I try to post this question to Stack Overflow I get the following error: Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the ...
Karessa Manning's user avatar
6 votes
0 answers
195 views

Code blocks not using fixed-width font family in Firefox

Code blocks are not rendered using a fixed-width font in Firefox 99 64-bit Ubuntu. A screenshot of the issue for this post (left is using Chrome, and right is using Firefox): The issue is caused by ...
Léa Gris's user avatar
  • 321
6 votes
1 answer
675 views

HTML formatting inside code blocks doesn't work if syntax highlighting is being performed for the block

I have plenty of old answers where I used <pre><code> to format code, with HTML tags such as <b> or <strike> inside such blocks. That has been broken for some time now, on SO ...
Erwin Brandstetter's user avatar
2 votes
0 answers
24 views

Display bug on code block in comments [duplicate]

I noticed this display bug on a comment, where the spaces inside code block is extended well past the comment width, and well beyond the content width as well, bleeding into the margins.
justhalf's user avatar
  • 128
4 votes
1 answer
808 views

Getting code formatting error on Stack Overflow

I don't know what is wrong with my indentation but it's not taking this input from me. I get the error: Your post appears to contain code that is not properly formatted as code. Please indent all ...
addy's user avatar
  • 51
3 votes
0 answers
330 views

The code used in code blocks for Stack Overflow has changed after I installed some new fonts on my system. How can I change it back?

I was installing and testing new fonts in my macOS for use in Visual Studio Code. After I was finished with that, I noticed the font has changed in Stack Overflow code blocks to one I do not prefer. ...
SantoshGupta7's user avatar
6 votes
1 answer
69 views

Code Markdown bug

I've only seen this happen on music.se, the latest one on Metronome Sound today. The last code block on a page renders as a blank box. It looks like a few people have had different attempts to get the ...
Tetsujin's user avatar
  • 7,587
4 votes
1 answer
89 views

Code formatting error for no reason

I have Mathematica code that I am trying to post, but to no avail. No matter what I try, I am still getting the code formatting error. The code is this: {18 wbcd^3 - 192 w^2 bde^2 + 18 b^3 cde + 144 ...
mnuizhre's user avatar
  • 149
4 votes
1 answer
1k views

"Your post appears to contain code that is not properly formatted as code." I have no idea why

I can’t seem to understand what is wrong with the following Markdown content. I keep getting the Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 ...
imtryin123's user avatar
15 votes
1 answer
127 views

Question Summary Text Outside Border

If text is formatted as code in a question and that text is used for the summary on the Questions page it will go past the border of the summary. Question Link I'm on Windows 7 64-bit, Chrome Version ...
Warcupine's user avatar
  • 251
13 votes
0 answers
488 views

How can I change the fonts of the code snippets in Stack Overflow back to Consolas?

I've installed the Windows Terminal from Microsoft Store and, together with it, the Cascadia Code font family (mono and code) in my system, but I don't use them. Since then, the snippets on Stack ...
Diogo's user avatar
  • 231
5 votes
2 answers
124 views

How do I handle suggested edits changing code block style?

I'm new to reviewing suggested edits, but one pattern I noticed is that many edits only change the style of code block formatting (mostly from indented to ```-based, example), in a way that does not ...
Caesar's user avatar
  • 153
3 votes
0 answers
35 views

Inline code formatting tries to escape the page! [duplicate]

I was going through the First Questions review queue, and was given this review. I don't think the inline code block should render like that. Even though the OP should have used a code block, I don't ...
cocomac's user avatar
  • 14.5k
6 votes
1 answer
209 views

Yet another error of "Your post appears to contain code that is not properly formatted as code"

I feel like I've found and read through all the relevant posts on Meta about this error, but I still can't resolve this error! I have about 6 equations in double-dollar-signs, several in single-dollar-...
Izek H's user avatar
  • 61
4 votes
0 answers
34 views

Code formatting fails for closing brace on some sites [duplicate]

The following block of code ``` } ``` renders correctly when asking a question on most sites, e.g. Stack Overflow and here on Meta: } However, on some sites, like Game Development and Code Review, ...
Glorfindel's user avatar
  • 252k
6 votes
1 answer
150 views

How should I represent/display pseudo code in Stack Exchange?

This semester I'm attending a course on Algorithms and Data Structures. I will probably have a few questions to post to Computer Science or Mathematics. The slides of my teacher use math symbols such ...
ilam engl's user avatar
  • 235
7 votes
1 answer
186 views

When someone adds a "language identifier" to a code block does the specified syntax highlighting show in the "suggested edits" "queue"?

When I edit someone's code block with a language identifier: Example: from: ``` def py ``` to: ```python def py ``` Is that change reflected in the Suggested edits queue in the Inline or side-by-...
NotStanding with GoGotaHome's user avatar
5 votes
0 answers
87 views

Add full screen button to code blocks

I suggest adding a "Full screen button" underneath code blocks. For example in this post: I get java.lang.VerifyError using FontAwesome in JavaFX The first code block, "Error", is ...
oriel's user avatar
  • 59
7 votes
1 answer
259 views

Markdown characters in code both shown and rendered as markdown

With certain syntax colourings active (for example "apl" but not "c"), and for certain specific characters, symbols that have meaning in markdown are visible while also causing ...
Adám's user avatar
  • 11.4k
12 votes
0 answers
217 views

I am being incorrectly told that "Your post appears to contain code that is not properly formatted as code." Please can I have more specific feedback?

I've been trying for about 30 minutes to work out what on earth in my message the system is mistaking for code, and every time I press submit and it tells me vaguely "oh I think there's code in ...
explodemydata's user avatar

1
2 3 4 5
15