Questions tagged [code-formatting]
For questions about making code appear correctly in questions, answers and comments.
857
questions
-10
votes
1
answer
82
views
How to format my comments that pasted a few lines of code? [duplicate]
How can I format my comments? For example, I've pasted a few lines of code (with new lines, spaces etc.) but it looks very ugly.
7
votes
1
answer
1k
views
Why doesn't the syntax highlighting work?
I tried several ways of how to do syntax highlighting for R in this question, but it doesn't work. I tried ```R (see revision 3 of the question) and <!-- language: R --> (see revision 2) but ...
5
votes
0
answers
80
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 ...
114
votes
2
answers
2k
views
Request for a possibility to adjust the spacing between lines
Update: The line-height in code blocks is almost back to what it was before (it was 1.3 but is now 1.30769231) and the spacing between lines in regular text is now at 1.5 (it was 1.3 before the change)...
0
votes
0
answers
41
views
Search results eat up formatted code [duplicate]
https://stackoverflow.com/search?q=user%3A3961546+iron+flash shows this:
Navigating to that response reveals that the {{> yield}} code markup was removed.
6
votes
1
answer
317
views
Xcode-snippets make code look like its inside a comment [closed]
When asking questions on SO that involve Xcode code-snippets, the syntax is to use a #, which makes the code look like it's inside a comment. For example this Xcode standard snippet for looping ...
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 ...
-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 ...
43
votes
3
answers
1k
views
Add format for logs/warnings/error messages which allows word-wrapping and preserves newlines
At the moment, we have these choices when providing error messages / logs:
Use code-blocks
This preserves the formatting of the error message, though it uses spurious highlighting and disables line-...
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}` ...
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 ...
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 ...
5
votes
1
answer
159
views
Cannot post my question because of code formatting [closed]
I tried to post a question on the Mathematica forum, I spend a hour writing it correctly and I have the following error when I want to submit it: "Your post appears to contain code that is not ...
1
vote
1
answer
211
views
Python formatting on iPhone
Python depends on formatting (new lines and indentation); it's part of the language.
However, the code markup in the editor messes with the formatting, sometimes incorrectly displaying multiline ...
6
votes
1
answer
676
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 ...