All Questions
Tagged with code-formatting stack-snippets
17 questions
-8
votes
1
answer
156
views
Displaying HTML first on Stack Overflow snippets [closed]
Currently, code snippets are displayed JavaScript first, then CSS and finally HTML. Regardless of the order they appear in the post source or anything.
This does not make any sense to me. Does it for ...
3
votes
0
answers
94
views
Is indentation in answer editor broken?
I edited this answer, and by the look of the things, I cannot understand what went wrong. The code is indented with spaces, but they somehow disappear in preview.
What did I do wrong?
(It's very ...
20
votes
2
answers
1k
views
All my code is properly formatted, yet I am unable to post an answer due to unformatted code. Why?
I was answering this question, and I was unable to post my answer due to containing code that is not properly formatted as code. All my code has been formatted properly as far as I can tell.
Here is ...
3
votes
0
answers
35
views
Stack Snippets syntax completely borks when indented by four spaces [duplicate]
Here's a Stack Snippet:
for(var o of document.getElementsByTagName("input")){(o=>o.addEventListener("change",e=>console.log(o.value=o.value?o.value[0]:"")))(o)};
input{width:1em;}
<...
17
votes
1
answer
502
views
How to use the regular code snippets in the 2018 Stack Overflow update
I am a little confused with the new update of Stack Overflow, particularly on using the regular JavaScript/CSS/HTML code snippets we used to have to write our questions. Now the new update made it ...
9
votes
1
answer
296
views
Is it possible to change formatting of console logs for JavaScript snippets? [closed]
Recently I was going to answer a JavaScript question. To prove my answer correctness, I inserted a code snippet that processed results and printed into console logs, something similar like:
var ...
2
votes
0
answers
39
views
Is it acceptable to edit out "stack snippet" formatting that has no benefit over `code formatting`? [duplicate]
This answer is a bit cluttered by the code snippet formatting and offers no value. I want to revert it to traditional grey code formatting with no buttons.
Question
Are there guidelines on how to use ...
-9
votes
1
answer
152
views
Feature request: Adding a Stack snippet can automatically detect what code is in the question already?
For context I see a lot of new users who fail to realize there is a runnable inline code snippet feature that lets them have a running example.
Now unfortunately I don't know if there is a better way ...
77
votes
1
answer
612
views
"=>" causes bad autoindentation in code snippets
Paste this JS code in the stack snippet editor:
(function() {
console.log(foo + "=>");
})();
Select it all with ctrl+A and use shift+tab to autoindent. The code becomes
(function() {
console....
11
votes
2
answers
312
views
How to improve questions to make them easier to comprehend?
I have recently been asking questions, and struggling to make my questions easier to read without hurting people's eyes or drawing their attention away from key elements. I don't want to have to flood ...
23
votes
0
answers
180
views
Visually group code and snippet icons, and clarify which one to use
Could we please revamp the editing toolbar to make it easier to use the correct code formatting tool?
In case you are not in the editor right now, here's what the toolbar currently looks like:
...
55
votes
2
answers
920
views
New Stack Snippets design requires more horizontal scrolling through code
I can't see the new Stack Snippet layout as an improvement. The window is now narrower, with wasted space around it, making it harder to format code to not require horizontal scrolling, especially if ...
7
votes
1
answer
960
views
External code snippet How-To?
I'm having a lot of trouble with code snippets. I like codepen.io, but here's me trying to paste the 'embed' code:
What I paste into the editor
<p data-height="265" data-theme-id="0" data-slug-...
2
votes
1
answer
67
views
Stack Snippet dialog can format code. Does it work for more than JS? [closed]
So I know that Stack Snippets can only run HTML/CSS/JS. But they have a neat formatting ability. You press the "tidy" button and it's like magic.
JS is part of the C style syntax family, so JS ...
18
votes
1
answer
396
views
Inconsistency of indentation of tabs between markup editor / code samples and Stack Snippets
Many real life projects contain code that mixes up tab-based indentation with space-based indentation.
In different editors, tabs don't always correspond with the same number of spaces. For example, ...