Questions tagged [code-formatting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21 votes
1 answer

How do I format some code specifically for the language used? Or how do I prevent it from being formatted? Which languages are supported?

If I format some code by indenting it using four spaces, the code is not formatted. How do I format some code specifically for the language used? Or how do I prevent it from being formatted? Which ...
kos's user avatar
  • 36.1k
18 votes
4 answers

What to do with <!-- language: bash --> edits?

Recently in the edit queue, there have been edits that only add <!-- language: bash --> to the post. These edits are made by the same user. And often 5-10 at a time. Is the color highlighting of ...
ravery's user avatar
  • 6,874
7 votes
0 answers

Preserve tabs in code

Tabs are currently rendered as spaces in code blocks. I'm sure this is just a symptom of Markdown or an otherwise well-intentioned method to standardise code samples... However some code needs tabs to ...
Oli's user avatar
  • 293k
6 votes
1 answer

Automatically wrapping lines in Ask Ubuntu

I'm new to forums and stuff like that. I need to post my wifi-info scripts output in Ask Ubuntu using Firefox and I need to keep it as it is without wrapping any lines. As soon as copy and paste it, ...
L_Cleo's user avatar
  • 101
6 votes
0 answers

Please use code fomatting for code, not quotes [duplicate]

This is some thing I see all the time recently and not just from new users. Users are using > to format there code and that is just wrong. Code should be formatted in one of these three ways ...
Mark Kirby's user avatar
  • 18.5k
5 votes
4 answers

Community consensus regarding using backticks or 4 spaces for code

There might be similar posts regarding this in the past. So, please forgive me. I often find it hard to edit a post which has lengthy code (indented using 4 spaces). Also, there are higher chances of ...
Random Person's user avatar
4 votes
1 answer

How to properly add code in comment

How can I properly add a line of code in a comment like this test test I like it more grey than test test if that is possible. Or if there is another way to define code in a comment to make it ...
An0n's user avatar
  • 2,139
4 votes
1 answer

How do I use the grey formatting in a comment? [duplicate]

Someone showed me (by editing my question for me) how to make some of your text show up grey to show it is code. Now I need to know how to do it in a comment.
XqRG's user avatar
  • 1
4 votes
0 answers

Scrolling code blocks glitch

This is me trying to scroll left and right on this code block (animated): Here are the still images: This is a copy of the problematic code block, which I first found in this question dpkg was ...
Tim's user avatar
  • 32.9k
2 votes
3 answers

How can I quickly and easily format my code for SE sites' posts?

I usually indent code with tabs, and every time I want to test a snippet before posting it to a SE site I have to reformat it manually before I can post it. Even when I don't use tabs, I need to ...
kos's user avatar
  • 36.1k
2 votes
0 answers

Preformatted text horizontal scrolling - bug or feature?

AskUbuntu help recommend to style pre-formatted text and console output with #four spaces But sometimes it results in scrolling text. See this question as an example. The problematic line (as ...
N0rbert's user avatar
  • 100k
2 votes
0 answers

Syntax highlighting doesn’t work on meta

When I enter <!-- language-all: lang-bash --> if :; then echo "quoted"; fi in a post on main, the output looks like this: Here on meta, the very same code gets no syntax highlighting at ...
dessert's user avatar
  • 40.1k
2 votes
0 answers

How can I shorten the Long Code output in questions and answers and display scrollbars?

There are some questions and answers that have very log output that is condensed with scrollbars. Is there a formatting method to control how much is displayed between the scrolling. I believe some ...
L. D. James's user avatar
  • 25.1k
1 vote
1 answer

How to write the grave accent to add code in the comment section?

I have a magic keyboard from Apple set on US language and I try to find the keyboard shortcut for the grave accent (`) to add code in the comment section on I don't want to copy-paste ...
Chookitypok's user avatar
0 votes
1 answer

Code Block Limit of 30000 characters

I came across a question where user had copied the output of a certain command and made a *.docx file out of it. The file was uploaded and the link was provided in the question to this file. I copied ...
Manish Kumar Bisht's user avatar
-3 votes
2 answers

Presentation of code should include explanation in a separate comment section

This is just an idea and I would like to see what the feedback is. The problem Starting Linux I've found myself many times looking through example code on this site and finding out what it actually ...
CatMan's user avatar
  • 1,409