For questions about making code appear correctly in questions, answers and comments.
16
votes
2answers
90 views
Syntax highlighting: <!-- language: lang-none --> does not seem to work for block quote
After using <!-- language-all: lang-sql -->, this is formatted as SQL:
SELECT * FROM foo LIMT 12345;
Next, a block quote (to keep line breaks!), but language syntax is not desired.
So I use ...
5
votes
1answer
51 views
Code blocks containing $ are indented incorrectly on MathJax-enabled sites
If you look at what is it called when encrypt('a') + encrypt('a') == encrypt('aa')? you'll see the first code snippet is indented all weirdly, however, if you try to edit the ...
-6
votes
0answers
32 views
Can we have links inside of code blocks? [duplicate]
Currently, no markdown is allowed inside of code blocks: observe
I can haz [link](http://meta.stackexchange.com/)?
This is normally a good thing, so that code blocks may need no escaping. The ...
0
votes
1answer
32 views
Site etiquette re: posting code and why doesn't Stack Overflow have a text editor? [closed]
I am having a little trouble knowing how to proceed on the site. When my questions were math-based I had less trouble, but now that I have moved to programming questions I have run into problems.
My ...
-5
votes
2answers
64 views
Unproblematic code in comments should appropriately formatted, at least with line breaks
I have come to believe that this should be a new question, but it has spawned from answers and comments I have written with regards to these two Meta Stack Overflow posts: Code in comments should be ...
1
vote
0answers
49 views
Problem in “Your post appears to contain code that is not properly formatted as code”
Ive the next question and when trying to post appears the message "Your post appears to contain code that is not properly formatted as code" . I dont know which part is missing the "formatting code" ...
3
votes
2answers
43 views
Code output spoiler / expander
There are many instances when the community requests the asker to run certain commands and post the output. They usually ask them to edit their answer and just dump the output of the requested ...
0
votes
0answers
24 views
Get keyword not highlighted (SO) [duplicate]
When I was browsing SO, I came upon a unexpected syntax highlighting quirk. In C# code, the "set" keyword, used in properties, was highlighted, but not "get". Could this be changed?
Here's a sample ...
0
votes
1answer
39 views
`console.log('Any way to format code in a question title?');` [duplicate]
I was just editing/improving a question and the original author had written a brief line of code in the title of their question. Was just wondering if there may perhaps be some way to format the ...
2
votes
0answers
27 views
minor bug in comment code tags [duplicate]
I seem to have found a minor bug in the formatting of code within comments. Code that ends in a = followed by a space "consumes" any space after it. I realize that multiple spaces are automatically ...
1
vote
1answer
29 views
How to add “Code sample” under “Numbered list”? [duplicate]
I want to add Code sample under Numbered List but unfortunately I am not able to do so.
Here is an example of what I want to achieve:
Using Numbered List -
This is my first point
I want to add my ...
0
votes
2answers
56 views
Trying to submit a question without any code… and getting a code-formatting error
Below is a screenshot of what I'm trying to post, it includes literally no code... and it's giving me a code-format error and will not let me post. I tried making the file names code, as you can see, ...
4
votes
0answers
53 views
Unable to post answer with formatted code [duplicate]
I have been trying to post an answer to this question:
Activate CSS3 animation when the content scrolls into view
I have read this but apparently I miss something probably obvious here because I am ...
3
votes
1answer
78 views
Guidelines / limits on code formatting in non-programming Stack Exchange communities
A recent discussion on linguistics.stackexchange revealed some differences of opinion about the proper use of backticks on the site. I have been instinctively using code formatting to separate object ...
8
votes
1answer
89 views
Your post appears to contain code that is not properly formatted as code (again)
I stumbled upon this error while writing http://stackoverflow.com/a/29850739/4486184
The problem was that I was missing a newline between the "==========" and the following code but the preview ...
2
votes
1answer
54 views
Is it OK to use a third party code formatting service while editing a post?
Whenever I see a poorly formatted post (might be a question or an answer) or completely non-formatted code, I use an online tool such as Instant SQL Formatter to format the code, and then I edit the ...
2
votes
0answers
25 views
Automatic code formatting [duplicate]
I am a frequent user of StackOverflow. Many beginner questions contain code that has no formatting at all, some even close to winning a code obfuscation contest. I try to answer even beginner ...
14
votes
1answer
190 views
Detection/fix for the hanging close bracket of a code block
I cannot recall how many times I have edited questions like this (look at the bottom part in red)..
Down there at the bottom is a } that should obviously have been included in the code block.
I ...
9
votes
0answers
100 views
google-code-prettify seems dead
The code formating engine used by SO (google-code-prettify) seems dead (lasts two commits have been made on sep 2013 & mar 2014). As stated on this post, each code-formatting request have to be ...
0
votes
0answers
14 views
What is wrong with the code blocks in my answer? [duplicate]
I answered my own question here: Softlayer HAProxy with failover and for some reason code formatting is all garbage.
I pasted my code into the editor, highlighted it and hit the code {} button above ...
1
vote
0answers
19 views
Code rendered as text when placed after a list [duplicate]
I have some problems formatting code on so. If i use only 4 spaces in the code snipped in this post: SO-Post, the code will not be formatted as code.
I think it has some thing to do with the list (1, ...
0
votes
0answers
32 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.
3
votes
0answers
49 views
Hidden quotes with code formatting are broken on beta sites
The code formatting background only displays when you have clicked on it and it is on always "visible" mode.
The text that is code blocks (fixed width) disappears before the main text. They do the ...
4
votes
1answer
40 views
nested formatting inside code block
I couldn't find an answer here in the Markdown Editing Help page.
What I am trying to do is this:
This is a block quote area where I would put code or a quote and I can bold text and add a cool ...
3
votes
1answer
32 views
Closing the Stack Snippet editor doesn't refocus the textarea
To reproduce:
Click Ask Question and focus the question body textarea
Press Ctrl + M
Hit the X and confirm that you do not want to "abandon any changes."
Immediately press Ctrl + M again.
No snippet ...
1
vote
1answer
29 views
Non-code text marked as code [duplicate]
Why am I seeing people marking technical parts of texts (names of functions, files) a code (e.g. `explorer.exe`), while logically it is not a code? I agree that these things should be somehow ...
4
votes
0answers
42 views
What's the format for 'Select item B from menu A'
When answering a question, is there a preferred StackExchange format for explaining how to do something in a GUI, optionally specifying shortcut keys?
Eg (terse) Window > Select next tab ...
2
votes
0answers
30 views
Safari messes up code wrapping in a comment
I noticed that Safari Version 7.0.6 (9537.78.2) on Mac Mavericks messes up with white-space: normal; on code tags on this very particular case :
While this one is fine. I can't figure it out.
Note ...
2
votes
0answers
10 views
Incorrect syntax coloring for bash $# [duplicate]
Background: In Bash, $# represents the number of arguments, and # starts a comment.
Consider the following Bash script:
# This is a comment
while [[ $# -gt 0 ]]; do
echo $1
shift
done
Note ...
2
votes
1answer
30 views
Why isn't the code block formatted correctly in this answer?
The very first thing in this answer to a Ruby question is a code block, but it's displaying as prose. But if you click "edit" to fix it, the code block displays properly in the preview pane!
It ...
3
votes
1answer
53 views
Distinguish languages when displaying stack snippets
I just integrated my first snippet on an existing post, nice work.
I put it on this post: http://stackoverflow.com/a/19932511/731138
Code appears without language distinction, with a small space ...
0
votes
0answers
9 views
Inconsistent escaping of backslash+backtick characters [duplicate]
When I type the following code:
backtick backslash backslash backtick
In a question or answer, it is interpreted as: \\.
However, in comments, the second backslash escapes the second backtick, ...
0
votes
1answer
84 views
How can I post a question with a long error message in it? [duplicate]
There are other questions that ask this but none of their answers have worked for me. I have a very long error message (well not so very long, 354 chars) and I'm trying to show it in a question I am ...
-1
votes
1answer
64 views
Penalty for flagging questions/answers
First of all let's read the help:
If you see anything in the system that is evil, weird, or in any way
exceptional and deserving of moderator attention for any reason…flag
it! That’s the ...
1
vote
1answer
50 views
How do you split a stack snippet into multiple sections? [duplicate]
Usually when I write an answer I explain each section of my code separately and then add a link to a JSFiddle demo at the end. For example take a look at this answer on StackOverflow:
Now with the ...
6
votes
0answers
90 views
We would like formatting for LOLCODE [duplicate]
This question is a very good question about LOLCODE code:
Down with FizzBuzz... LOL
The formatting is pretty good except for the comments, which aren't formatted as comments.
I can see this being ...
21
votes
2answers
188 views
Code formatting with Stack Overflow, Programmers and Code Review
My eyes are destroyed, so I'm using a screen reader. Whenever I post some codes to Stack Overflow and Code Review, I always got some comments about my code formatting not being readable and indented ...
25
votes
2answers
242 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 ...
34
votes
2answers
345 views
Should Shift + Spacebar create a tab indent in SE?
I asked a discussion question about whether or not giving tabs formatting functionality would improve UX, and after trial and error on this solution, would like to present it as a feature request.
...
1
vote
1answer
63 views
Tags that format the indented code: what precedence is given?
Here is an example:
VBA openweathermap XML retrieval
The code used in this Q is VBA. OP has also tagged it as XML (which I would consider appropriate since it's dealing with XML parsing, ...
7
votes
3answers
213 views
TAB formatting when editing code samples in SE — Will it improve UX?
Do you think that giving TAB formatting functionality will improve UX?
I've seen people complain about not been able to use TAB to format code in SE. There are many fixes such as:
format code in ...
5
votes
0answers
32 views
Evaluate the FR for: Add increase/decrease indent buttons to the wysiwyg editor [duplicate]
A long time ago there was a feature request asking to add increase/decrease indent buttons to the editor toolbar:
These should work by adding spaces or removing spaces from the beginning of the ...
1
vote
1answer
121 views
Code blocks don't show up as monospace text on the mobile website on Android
I'm using a Nexus 5. When browsing the mobile website on the browser (Chrome) with "Request Desktop Site" turned off, I get this appearance for code blocks (on this answer):
This is rather ...
2
votes
0answers
44 views
“Post contains improperly formatted code” - Cannot find any misformatted code [duplicate]
I tried to post this exact answer on Stack Overflow, however it refuses to let me do so.
I tried searching around a bit, and found some people suggesting adding extra line breaks before code blocks. ...
0
votes
1answer
43 views
Stack Overflow tells me to add more details when I trying to indent other user's question
This question has bad indentation of code. However, I cannot save the modified (with code indented) question because it is mostly code.
Why this question could be submitted and why I cannot submit ...
1
vote
0answers
44 views
What to do for code formatting bug on StackOverflow? [duplicate]
Looks like SO's code formatting has a bug and it's ignoring first few lines no matter what I do. Not sure who to contact but if you know the solution or can tell how to forward to SO's developers that ...
4
votes
0answers
33 views
Code block in comment not working when first character is a whitespace
I just added a comment for this answer when I found there is something going wrong in recognizing code blocks in comments (the same thing seems to work in questions and answers).
I entered this in ...
13
votes
1answer
91 views
Can formatting make harder to find the question on a search engine?
Sometimes in Chemistry S.E. I use latex formatting e.g. $CO_{2}$ for CO2 or $\ce{H20}$ for formatting H2O. I would like to know if formatting can make it harder to find the question in a search ...
-6
votes
2answers
118 views
Posting is difficult for some
Is there a beginner's tutorial on how to post a question on stackoverflow?
I'm not completely stupid, but after a half-hour of editing and re-editing, I gave up.
My post initially was as a commented, ...
-2
votes
2answers
205 views
Why do some code formatting-only edits get rejected?
I have noticed recently that when I reformat code in a question or answer (generally from something with no carriage-returns or something extremely hard to read to properly indented code for ...