Skip to main content

Questions tagged [code-formatting]

Filter by
Sorted by
Tagged with
1 vote
1 answer
69 views

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 askubuntu.com. I don't want to copy-paste ...
Chookitypok's user avatar
5 votes
4 answers
259 views

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
2 votes
0 answers
195 views

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
  • 102k
2 votes
0 answers
60 views

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.6k
-3 votes
2 answers
91 views

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,419
4 votes
1 answer
86 views

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
6 votes
1 answer
99 views

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
4 votes
1 answer
201 views

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,177
18 votes
4 answers
410 views

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,904
2 votes
0 answers
111 views

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.3k
0 votes
1 answer
209 views

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
6 votes
0 answers
65 views

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.8k
2 votes
3 answers
96 views

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
  • 40.9k
25 votes
1 answer
458 views

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
  • 40.9k
4 votes
0 answers
75 views

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
  • 33.3k
7 votes
0 answers
60 views

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
  • 297k