Questions tagged [stack-snippets]
Stack Snippets are runnable code sandboxes of the front-end languages HTML, CSS, and JS for use within a Stack Exchange post. Use this tag for bug reports, feature requests, and discussions explicitly relevant to these snippets and their underlying technologies.
143
questions with no upvoted or accepted answers
78
votes
0
answers
754
views
Add an option to hide or collapse less relevant snippet sections
Snippets are very useful, but often fill up a lot of the answer with irrelevant code.
(E.g. in JavaScript questions, often the solution can be demonstrated by changing a tiny part of the JavaScript ...
69
votes
0
answers
1k
views
Update the version of Babel Standalone (and others) used by Stack Snippets
Please update the version of Babel Standalone used by Stack Snippets (and update the available versions of other scripts in the drop-down lists; ideally, update that list automatically). It's ...
61
votes
0
answers
448
views
Replace code snippets by normal code block if JavaScript tag is absent
Some users (probably mostly new users) tend to use the "code snippet" tool for code in languages that aren't supported by Stack Snippets.
Would it not make sense to disable the code snippets ...
49
votes
0
answers
399
views
Abusing the Code Snippet for wrong languages
I see this at least once a day, someone puts their Java or even C code in the Code Snippet thing that's meant exclusively for HTML / CSS / JS.
What it means - someone has to manually remove the magic ...
46
votes
0
answers
745
views
Don't push my tab's history too far
Whenever I click on Stack-Snippets®'s in any post, a new entry is made in my tab's history (the one for the back and forward buttons, accessible through window.history in js).
I like to keep my tab's ...
43
votes
0
answers
679
views
Use HTTPS for snippets because some features are HTTPS only
Many features of the browsers are starting to require HTTPS which means they don't work on Stack Overflow snippets. Please consider using HTTPS for Stack Overflow snippets.
I recently tried to answer ...
43
votes
0
answers
737
views
Create a magic link introducing stack snippets
I just happen to come across another fiddle request.
One feedback this thread: Inform the users about the existence of stack snippet while requesting external demos in comments received was the ...
40
votes
0
answers
330
views
Allow us to choose a doctype for Stack Snippets
Sometimes a specific doctype is required to reproduce an issue. Currently it's not possible to specify a doctype for a Stack Snippet's html section. I've tried this:
<!DOCTYPE html PUBLIC "-//...
38
votes
0
answers
210
views
Add information on Stack Snippets to Help Center
There isn't currently any page on the Stack Overflow help center that relates to Stack Snippets, and a search for that term in the help center does not return any valid results.
I have twice used a ...
37
votes
0
answers
499
views
Close Snippet obstructed in Full Screen
Alter the z-index of fixed top bar when using Full Screen Snippets has been fixed. But click on the full screen preview and try to close the snippet?
Hello! Click on the full page above right and ...
37
votes
0
answers
334
views
Code Snippet as a formatting tool
Since the Stack Snippet is being misused, let us make it a feature!
My proposal is to add a dropdown to select the language, and let people paste their code inside to format the code. The language ...
36
votes
0
answers
538
views
Please Fix Stack Snippets
Please fix the many outstanding issues with Stack Snippets:
Why won't this snippet with async await work here on Stack Overflow snippet editor?
Update the version of Babel Standalone (and others) ...
32
votes
0
answers
392
views
Update for: Help > How do I ask a good question
This is the help topic I am referring to: https://stackoverflow.com/help/how-to-ask.
It states:
If it is possible to create a live example of the problem that you can link to (for example, on ...
30
votes
0
answers
526
views
Why isnt Angular 1.3.x available in code snippets?
Yes, I know I can just change <script src=.... to 1.3.x, but I'm just wondering if there is a reason why 1.3.x is not in the dropdown. Its been out for a while and is stable.
I would ask same ...
28
votes
0
answers
426
views
Can we get React v16 as an option in Code Snippets?
A few weeks ago the first stable version of React v16, also known as React Fiber was released. This is a complete re-write of the core React architecture.
While React v16 and preceeding versions are ...
27
votes
0
answers
317
views
Weird bug when deleting code in stacksnippet
The last times I used a code snipped I noticed that it doesn't work as expected when I want to delete some code. And it seems that the marking (or selecting) doesn't work properly either.
See my ...
27
votes
0
answers
346
views
Are there any built-in resources that you can link to from within question to use in a code snippet on the Stack Overflow domain?
I answered this question, which asks how to be able to start/stop an audio clip on mouse enter/leave. I came back to it while later after seeing the new runnable code snippets and wanted to play ...
25
votes
0
answers
273
views
Snippet Editor gets out of sync scrolling and gets very difficult to use
Generate a 1000 lines and paste it into the JavaScript area of a snippet
I just opened the JavaScript console and typed
a = []; for (var i = 0; i < 1000; ++i) {a.push("line:" + i); } console.log(...
24
votes
0
answers
252
views
'run code snippet' buttons misaligned
I was looking at an answer that had a 'run code snippet' section, and the buttons below it look misaligned - the 'copy snippet to answer' button is higher than the 'run code snippet' button by 1 pixel....
23
votes
0
answers
176
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:
...
22
votes
0
answers
460
views
"Show code snippet" chevron is underlined
Links in posts on Meta are given a bottom border:
.wmd-preview a, .post-text a, .comment-copy a {
border-bottom: 1px dotted #444;
}
This results in the chevron next to "Show code snippet" also ...
21
votes
0
answers
325
views
Hidden Stack Snippets are not accessible and violate web standards
I noticed recently in a question about accessibility, that a snippet I included (marked as hidden by default; as it includes more details then strictly necessary for the question) is not very ...
20
votes
0
answers
620
views
When is it inappropriate to use a code snippet?
I've created answers that contain a runnable code snippet to provide a convenient method for readers to view a demo of my answer's solution. For instance:
In my opinion, this answer:
highlights ...
19
votes
0
answers
228
views
Please make the font and color settings in the snippet editor match the result in the question's code block
I only noticed today that there is mismatch between the display in the StackSnippet editor:
and the resulting HTML in the code block in the question:
First of all, the color coding is different, and ...
19
votes
0
answers
387
views
Inform the users about the existence of stack snippet while requesting external demos in comments
I love stack snippets.
It makes it a lot easier to play with the OP's problem and post an answer with a working demo.
I've been seeing a LOT of users STILL requesting for an external demo along the ...
17
votes
0
answers
306
views
Add a means for tab stacking code snippets
The vast majority of questions on Stack Overflow come with a specific language tag and no post in the tag will contain any language other than that specified language.
However, for some questions are ...
15
votes
0
answers
274
views
Add a "run" option next to "show" for hidden snippets
Title pretty much says it. My current choices are either to show the snippet and have a run button, or to hide it and not have a run button. Sometimes, you're just changing a single line of code but ...
14
votes
0
answers
203
views
Snippets comments are incorrectly parsed inside code blocks producing strange output
I was editing the following question, as the code blocks needed indenting, and noticed there was an problem with the html comments.
Post: setOnItemClickListener for listview
Here is the code I had ...
14
votes
0
answers
286
views
Edits from different tabs being added as new answers
Very weird things happened today:
I saw a question, which can be answered better with a demo. So I opened a
new jsFiddle window (see at the bottom why).
I added some CSS, made a demo in jsFiddle and ...
14
votes
0
answers
123
views
Consider changing StackSnippets icon image
It just doesn't seem to match the rest of the icons in the editor:
It almost looks like an icon that was created a decade ago. Could we use something more that signifies a script...Something more ...
13
votes
0
answers
276
views
Do we really need to validate "file" extensions for externals in the code snippet editor?
As we all know, "file"-suffixes are effectively meaningless w.r.t. HTTP URLs. The type of the resource is determined by the Content-Type header, not its path-suffix.
So, I tried to add the following ...
13
votes
0
answers
189
views
Saving a Stack Snippet resets scroll to the top of the page
I've noticed while adding Stack Snippets or editing existing ones to answers, the scroll position is being reset to the top of the page when you click "Save and Insert into Post" to save your Stack ...
13
votes
2
answers
385
views
use repl.it to add snippets for more languages
Now that we have snippets (which are awesome), I would like to suggest we use repl.it to add support for more languages that are not just web-related.
I know snippets just started, so implementing a ...
12
votes
0
answers
184
views
Doubled stack snippet buttons
Sometimes after I post a comment or edit the question or answer, the buttons below the stack snippets in the question get duplicated.
I haven't been able to reproduce this reliably, but I first ...
12
votes
1
answer
414
views
Stack Snippets Is Down Again
https://stacksnippets.net/ is returning:
500 - Internal server error. There is a problem with the resource you
are looking for, and it cannot be displayed.
Test:
Hello World
11
votes
0
answers
456
views
Stack Snippet works in Firefox but not in Chrome
The snippet in this post is not working in Chrome (version 55.0), although it works fine in Firefox (version 45.0)
I see the following error message:
Uncaught DOMException: Failed to read the '...
11
votes
0
answers
140
views
New stack snippet doesn't show up last lines when editing until I hit Enter
UPDATE: The bug continues...
So I found this bug, New Stack Snippet can't edit last lines, a few days ago when the new stack snippet was launched, and it was fixed right way.
However, at the ...
10
votes
0
answers
36
views
Easily switch between stack snippet view and question view
I love stack snippets. But the problem with stack snippets is that if I am working on the snippet, I can't see the question I'm answering.
Currently there are two options for referring back to the ...
10
votes
0
answers
94
views
Back button when viewing full-page snippet
When viewing a snippet in "Full page" mode it would be nice if you could use the browser's "Back" button to close it.
Additionally it would be nice if the iframe running the snippet was created in a ...
10
votes
0
answers
687
views
Emmet in StackSnippets™
I think it would be a very nice addition to the StackSnippets™ to have Emmet implemented in the editor.
This is NOT an HTML/CSS replacement, it's a productivity tool meant to help you write ...
9
votes
0
answers
195
views
Stack Snippets Returning a 503 Service Unavailable Error
Not sure if it's just me but Stack Snippets seems to be down
E.g. http://stacksnippets.net/
Hi
9
votes
0
answers
257
views
Approving/Rejecting edit suggestion reinitiates snippet
Looks like the snippet is reinitiated for the second time after approving or rejecting an edit suggestion that uses the snippet.
Example 1:
Example 2:
9
votes
0
answers
78
views
Embedding stack snippets inside codeblock
I noticed earlier on today that a snippet can be embedded inside a codeblock, resulting in a buggy rendering:
Or, with an actual snippet:
//And JS too!
/*
* And some CSS
*/
...
9
votes
0
answers
212
views
Stack Snippet vs Code Snippet - Inconsistent naming
Following is the tooltip for stack-snippets :
Stack Overflow:
Meta Stack Overflow
Meta Stack Exchange
Why do we generally call it stack-snippets, but the tooltip reads code snippet..?
...
9
votes
0
answers
71
views
Flow for using Stack Snippets in comments
It can be very useful to use a snippet when asking for clarification in a comment. For example in this question I posted such a comment:
There's something else going on in your styles. The code as ...
8
votes
0
answers
72
views
Can we add support for React 16.8 (or latest) in Stack Snippets?
Currently Stack Snippets supports up to 16.6.3. It will be great to add the support for 16.8 as this is a major release because of React hooks support.
Now the alternative is each time manually add ...
8
votes
0
answers
147
views
Snippet controls appear twice after completing a review
TL;DR:
Reproduction steps:
Find a post with a pending suggested edit to add a snippet; in my case, I handled the review from the "edit (1)" link rather than through /review.
Switch to "rendered ...
8
votes
0
answers
267
views
I cannot edit snippet when improving edits
As said in the title, when I find a pending edit and I try to improve it I cannot edit the snippet inside:
I don't know if it was always the case but I am pretty sure I was able to do this before....
8
votes
0
answers
217
views
Why can't I "Full page" a js/html/css snippet in a new tab?
At the bottom of javascript/html/css code snippets, when clicking Full page, the current page is simply replaced with the full screen result of the snippet; and no way to get back to the post.
...
8
votes
0
answers
266
views
Snippet console logging JavaScript exception as empty object when using .log
When a JavaScript exception is caught in a snippet and the exception is output using console.log, it appears as an empty object.
Example:
try {
let foo = null;
foo.bar;
} catch(exception) ...