Questions tagged [code-formatting]

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

Filter by
Sorted by
Tagged with
6 votes
0 answers
126 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 ...
user16217248's user avatar
  • 1,323
-8 votes
0 answers
67 views

Typesetting with MathJax doesn't work [duplicate]

I don't see why this post gets a completely bugged typesetting. On one line, $(\U_\fm)_\fp$ pass and not on another one or doesn't if I add just a "=U". I precise that I already posted this ...
noradan's user avatar
7 votes
1 answer
117 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
  • 11.6k
4 votes
1 answer
133 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
202 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
  • 370
4 votes
0 answers
175 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
140 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
105 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
79 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
46 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,127
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
  • 248k
12 votes
0 answers
115 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
138 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,210
16 votes
0 answers
174 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
  • 11.6k
7 votes
1 answer
130 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
208 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
100 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
125 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
82 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
186 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,434
8 votes
0 answers
76 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
117 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
138 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
177 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
5 votes
1 answer
532 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
673 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
285 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
68 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
  • 6,402
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
800 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
125 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
11 votes
0 answers
451 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
  • 211
5 votes
2 answers
117 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
  • 11.6k
6 votes
1 answer
206 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
  • 248k
6 votes
1 answer
149 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
180 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
81 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
206 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.3k
12 votes
0 answers
212 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
7 votes
1 answer
105 views

Erroneous "Your post appears to contain code that is not properly formatted as code" error

I spent more than an hour trying to fix the formatting of the question below such that the Mathematica and Wolfram Language forum would accept it. I had no success, even though I am aware of threads ...
B K's user avatar
  • 221
7 votes
1 answer
74 views

Quote button shouldn't reformat code in triple-backticks

I've seen Blockquote rewrap destroys code, but that question (and answer) are about the situation where a user mistakenly uses the quote button instead of the code button. I instead want to use both. ...
jamesdlin's user avatar
  • 608
4 votes
1 answer
165 views

Some lines of code block are bold when the question has at least two language tags

We've found this problem in this question on Stack Overflow in Portuguese, but I've also tested in other sites (English and Spanish SO's), and it happened there as well. In the aforementioned ...
hkotsubo's user avatar
  • 2,306
-14 votes
1 answer
234 views

I need help and the site is not letting me post my code. Says “Your post appears to contain code that is not properly formatted as code.”

I am trying to learn React and there's a concept that I'm feeling pretty stuck on. I was hoping someone could help me and I've been trying to put effort into making a question post detailing my ...
greenga95's user avatar
2 votes
1 answer
383 views

Triple backticks code formatting doesn't show up in the suggested-edits queue on side-by-side mode

I just noticed that answers (I don't know about the questions), that used triple backticks codes in the body, don't show up in the suggested-edits review queue on side-by-side mode. Instead it shows ...
αғsнιη's user avatar
2 votes
0 answers
87 views

Prefer code fences or indenting? [duplicate]

Personally, code fences are cleaner (less whitespace) and are parsed more quickly due to the ability to hint at the language via cpp,lang-none,js, etc. Other than requiring indenting to use code in ...
Casey's user avatar
  • 159

1
2 3 4 5
15