Questions tagged [stack-snippets]

Stack Snippets are runnable inline code samples. Currently HTML, CSS, and JavaScript are supported. Use this tag for bug reports, feature requests, and discussions explicitly relevant to these snippets and their underlying technologies.

Filter by
Sorted by
Tagged with
203 votes
6 answers
5k views

Add a console to Stack Snippets

Currently, to see console.log() entries from StackSnippets, you need to open your browser console, and make sure it's recording from frames. Things could be a lot simpler if you would add a console to ...
  • 14.6k
62 votes
12 answers
1k views

Stack Snippets Upgrade: Virtual Console

It's been a long time since we worked on Stack Snippets. I'm sorry. It's mostly because I created it, then I got promoted to management, and now I don't code much anymore and nobody else has time to ...
  • 7,373
21 votes
1 answer
340 views

On what sites are Stack Snippets enabled?

Stack Snippets is now a feature on some Stack Exchange sites. On what sites is this feature enabled? Where is it being discussed? And where has it actively been decided not to implement the feature? ...
43 votes
25 answers
5k views

Stack Snippets Sandbox: Try It Out Here! [duplicate]

This post is dedicated to testing out the newly announced Stack Snippets feature. Feel free to answer with your own Stack Snippets!
4 votes
0 answers
119 views

If you run a code snippet, a hat still appears (hats are above snippets in the Z-order) [duplicate]

If you run a code snippet, a hat still appears. Steps to repro: Go to a question where there is a snippet and where the OP wear a hat well, if you find that hard, just go here. rowspan not changing ...
  • 566
13 votes
1 answer
137 views

Clicking to reload an updated answer removes the code snippet buttons and removes syntax highlighting

If you are looking at an answer with a code snippet in it, and the answerer updates the answer, you see An edit has been made (etc.). If you click that, the answer is refreshed, but the code snippet ...
  • 451
10 votes
0 answers
176 views

Code snippet comments in code formatting break the formatting of the post

When special HTML comments used for snippets are present in a post, these comments break the rendering of the post. For example, consider the following markdown code (notice that the whole thing is ...
  • 7,717
6 votes
1 answer
95 views

How do I select which lines of code to show and which lines to hide?

Sometimes only 10 lines of 100 are relevant to the question/answer, the other 90 are setup. Is there a way to hide 90 those in lines in the answer?
  • 4,270
4 votes
1 answer
219 views

Do Stack Exchange sites allow to include copyright/license in code snippets?

Suppose we see an answer with a code snippet like this: // Copyright (c) 2017, <some guy's name and email> // // Permission to use, copy, modify, and/or distribute this software for any // ...
15 votes
1 answer
115 views

Stacksnippets has the incorrect SSL certificate :(

As discussed here, was prompted to post it as a brand new question, so here it is :-). Earlier today there was an issue with Stack Snippets, caused by the move to Denver. That issue was fixed, but ...
  • 589
10 votes
0 answers
158 views

Allow hiding walls of text somehow

Sometimes there are questions which could benefit from additional information in an unobstrusive way. Example: A question about a bug in an MCVE with sample data to use. It might be nice to allow ...
9 votes
1 answer
145 views

Can I call out different parts of a snippet

I often format answers something like Do this var a = b * c; Then do this log("the answer is " + a); Is it possible to pull those lines separately out of a snippet of say 10 lines to include in ...
  • 4,270
7 votes
0 answers
74 views

Snippet CSS content is corrupting the console display

I have encountered a bug in the Stack Overflow snippet interface. I have created a div and wrote some css in the CSS section for the same. I noticed that the div CSS content is affecting the console ...
  • 209
4 votes
0 answers
73 views

Browser back leaves page after going fullscreen in stack snippet

Opening a Stack Snippet in full screen should use history.pushState() to add an entry to the browser history stack. Clicking back will then close the snippet rather than leave the page completely.
3 votes
0 answers
105 views

Copy-paste from question to snippet

When I'm editing a stack snippet, I often want to copy code from the original question into the snippet. But while the snippet editor is on display, there's no way to access the question, other than ...
  • 1,933
22 votes
2 answers
189 views

After the move to Denver Stacksnippets.net is offline

After the move of all services to Denver it was tweeted that there was some performance degradation. Initial reports showed that at least chat search seemded to be the victim of that. I would like to ...
  • 83k
21 votes
2 answers
560 views

How is my browser protected from XSS in Stack Snippets?

Firefox 32.0.2 with NoScript and AdBlockEdge. Steps I have done to enable Stack Snippets: Allowed scripts from http?://stacksnippets.net In NoScript settings, went to XSS tab and added exceptions ...
  • 6,157
20 votes
1 answer
314 views

Who sniped the snippet?

I am trying to ask a question on Stack Overflow but the code snippet button is missing for some reason. Expecting this Currently Available How can I bring back the code snippet?
  • 303
20 votes
0 answers
178 views

Deploy updated snippet script and implement a UI for the Stack Snippet console options

Back in May 2016 @canon implemented several useful options in the Stack Snippets console script (there's a demo here). Please Deploy the updated script so those options can be used (currently, only ...
  • 22.6k
16 votes
1 answer
125 views

Ejecutar (Run) button background is the same color of the button text: white

This is related to Submit buttons change color when hovering on non-English Stack Overflow sites, but in this case it's a problem because the button background is the same color as the button text: ...
  • 8,098
15 votes
2 answers
274 views

Snippets editor won't insert and close on SO

This just started: I went to add a snippet to an answer on SO, typed it in, clicked the Insert button, and...nothing. No error in the console, but nothing inserted in the question. Earlier today they ...
  • 22.6k
14 votes
0 answers
162 views

How to make use of the "Stack Snippets" more intuitive to new users?

I noticed that some users are using the Stack Snippets for ruby, vb, java, php and other "things", even though implicit in the text fields the words html, css and javascript. I suggested: ...
14 votes
3 answers
282 views

Are Stack Snippets a good enough reason to increase the 30k post limit?

On all public Stack Exchange sites, questions and answers cannot be longer than 30,000 characters. One clear benefit to this limit is that users won't attempt to post tens of thousands of characters ...
12 votes
0 answers
176 views

Snippet Tidy breaks Optional Chaining

The Tidy button is adding spaces before and after any question mark that is part of an optional chaining operator (?.). This breaks optional chaining. It appears to be recognizing question marks as ...
9 votes
0 answers
221 views

Improved support for React in the code snippet editor?

Overview of Feedback Supported React Versions Development vs. Production Auto-enable Use BabelJS / ES2015 Insert React boilerplate React Version Currently, the newest version of React available in ...
  • 199
9 votes
0 answers
88 views

JavaScript code snippet Tidy function injects a separating space into the null coalesce operator

For JavaScript snippets, the Tidy feature injects a space between the question marks that compose the nullish coalescing operator ??[1]. Example: Prior to Tidy: console.log(((a, b) => { return a ?...
6 votes
0 answers
122 views

Can't run Stack code Snippets on the mobile site

Is it a known issue that stack snippets don't have the "Run code snippet" button underneath on the mobile version of the site? Searching for this yielded nothing, both on MSE and MSO. I've posted a ...
5 votes
1 answer
3k views

ERROR(1): User denied Geolocation

While I was researching in order to answer a question on Stack Oveflow en español, I decided to try the code on https://developer.mozilla.org/docs/Web/API/Geolocation/getCurrentPosition1. But I got ...
  • 8,098
5 votes
1 answer
100 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: https://stackoverflow.com/a/19932511/731138 Code appears without language distinction, with a small space as ...
  • 625
4 votes
0 answers
63 views

Allow the stack snippets console to be maximized

Consider the following stack snippet: // A Tree(a) is one of: // - null // - tree(a, Tree(a), Tree(a)) const tree = (value, left, right) => ({ value, left, right }); const buildTree =...
4 votes
0 answers
66 views

Snippet editor for touch devices can be opened if you show perseverance

Opening a code snippet editor via the button from the toolbar cannot be used on touch screen devices like my iPad, i.e. I see the following notice: But occasionally tapping code snippet button ...
3 votes
0 answers
49 views

Why aren't runnable code snippets formatted correctly within lists?

Consider the following code snippet. console.log("this line is all right"); console.log("but this line is indented"); This should be a part of the same bullet point but it's not. ...
3 votes
1 answer
91 views

Stack Snippet editor doesn't close with the background fade

While I was answering a question on Stack Overflow I wanted to insert a snippet... but then I changed my mind and pressed on the grayed out space near the snippet window (without releasing the mouse, ...
  • 183
3 votes
0 answers
50 views

The console should not display inherited properties

Currently, when you log an object to the virtual console, it shows all enumerable properties, both own and inherited. I think the inherited ones should be filtered out. Otherwise, the result can be ...
  • 1,423
2 votes
0 answers
45 views

Clicking back button after entering full screen [duplicate]

I'm clicking Run code snipped, then Full page and then the back button in my browser. And now I get a white blank page with only Close button. Expected results: the full screen should close and the ...
  • 121