Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

1
vote
0answers
28 views

Does code snippet support CSS modules?

I want to ask a question related to CSS modules (https://github.com/css-modules). Is it possible to use CSS module syntax in a snippet? Such as @value? If yes, how can I enable it?
2
votes
2answers
56 views

Embedding code sandbox

Is it possible to embed codesandbox preview in Stack Overflow? I have tried iframe, embed URL and links but none of it works.
3
votes
1answer
55 views

Creative Commons Attribution-Share Alike and licences information on delivery

is it sufficient to add the Creative Commons Attribution-Share Alike Attributions inside the source code or should it be also added inside a separate licensing file on delivery. E.g. I create a ...
4
votes
0answers
48 views

Stack Snippet console bug

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 ...
2
votes
0answers
24 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 ...
12
votes
0answers
83 views

Add detailed help for Stack Snippets to the editor's “Code” section and the advanced help

Stack Snippets are markedly under-documented. Please update the "Code" section of the help you get when you click the (?) icon in the editor, as well as the advanced help, to provide detailed ...
5
votes
2answers
61 views

Is it new stack snippets feature: show few snippets in one scrollable block? [duplicate]

If snippets code have four spaces from start line, then in preview shown just And in finish view snippets shown in one scrollable block (function(){ // some code // some code /...
2
votes
0answers
37 views

How to add multiple HTML pages to code snippets on Stack Overflow [closed]

How do you add multiple HTML pages to code snippets on Stack Overflow? If your code is interlinked with multiple HTML pages, then how do you add multiple pages in code snippets on Stack Overflow?
2
votes
0answers
29 views

Console on snippet going behind contents

I was googling for a code and I reached this Stack Overflow page. Owl Carousel on change not working I tried running the code in answer and it will log something in console in every slide change. ...
2
votes
0answers
27 views

Is the behaviour of code snippets correct, when doing a review task?

I was reviewing a post, and it looked to me that it had an obvious error in its code-- but it had a Code Snippet button, so I decided to click it to make sure this obvious error was there. Sure ...
5
votes
0answers
26 views

Prompt for confirmation when navigating away from stack snippet

In the following specific case: Click 'Ask Question' Click the stack snippet button without entering any other text or question titles or anything in the editor first. When you navigate away from ...
3
votes
1answer
42 views

While undeleting deleted answer, the snippet seems missing

Yesterday I made an answer to this question Why does width and height affect how a flex item is rendered?. I got some downvotes and so I decided to check am I missed something. I temporarily deleted ...
14
votes
0answers
210 views

SCSS, Sass and other CSS preprocessor support for code snippets

Add a possibility to run SCSS, Sass and other CSS preprocessors (LESS, Stylus, PostCSS, maybe others) in code snippets. Many developers use CSS preprocessors. This will remove need to convert demos to ...
2
votes
0answers
45 views

Add allow-same-origin to the Stack Snippet sandox in order to be able to run Geolocation API

Related support question: ERROR(1): User denied Geolocation Please add allow-same-origin to the Stack Snippet sandbox in order to be able to use the Geolocation API. As example, the following code ...
5
votes
1answer
811 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
votes
0answers
63 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 ...
-3
votes
1answer
54 views

Code snippets numbering lines with Number Anchors

This topic has been discussed before in Why are there no line numbers in the code listings?. The most powerful reason that prevents the implement of line numbers is changing code lines numbers and ...
3
votes
0answers
18 views

Repeating Run Code Snippet row when other answer gets reloaded

In a nutshell, this is the problem: You have an answer with a code snippet. There's another answer that just got updated. You see the "an edit has..." message and click on it. The moment, the other ...
4
votes
0answers
60 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 ...
11
votes
1answer
98 views

New code snippet causes error on submit?

StackOverflow's editor seem to have changed, or to be more precise, the settings for the snippet editor that allow to run code in questions/answers have changed. The snippets are now executed in a ...
3
votes
1answer
98 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 // ...
2
votes
0answers
34 views

Folding Sections in Answers [duplicate]

We already have the spoiler formatting for information that should be hidden until specifically needed (by hovering), and the code snippet formatting like this for code that can be ...
5
votes
1answer
136 views

Why is there a script error in all Stack Snippets?

I am not sure whether this has been asked before or not, or if anyone else has this problem. I get this "script error" everytime I execute any script in the code snippet tool of Stack Overflow. I have ...
3
votes
0answers
32 views

Make Ctrl+Enter a shortcut for running a Stack Snippet

It would be nice if pressing Ctrl + Enter when editing a Stack Snippet would run it.
1
vote
0answers
108 views

Dojo Toolkit (Dijit) example does not work in Stack Snippet

This snippet is adapted from http://dojotoolkit.org/documentation/tutorials/1.10/dojo_data/demo/store-adapter.html. The snippet works in FireFox, but Chrome gives a browser error: Uncaught ...
1
vote
0answers
30 views

Snack snippets sandbox makes Chrome web browser unresponsive

The sandbox linked to in the [snack-snippets] tag wiki makes my browser sluggish/unresponsive. My CPU usage jumps to 25%, so I think there are either too many snippets, or some of them require too ...
-4
votes
1answer
139 views

How I can add my PHP code in to code snippet?

When I asked a question on Stack Overflow the other users replied me to add a live demo. But my code contains a PHP part also, and I can't see a method to add codes other than HTML, CSS and JavaScript ...
16
votes
0answers
96 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 ...
2
votes
0answers
95 views

Code snippet editor is not loading in Chrome!

I don't know whether this is a bug or security issue with chrome. But I'm getting a screen like this when I click on the snippet button. Any help would be helpful. Chrome Console This is what I'm ...
6
votes
1answer
56 views

Typo in Stack Snippets: “Javascript” should be “JavaScript”

That's not a pluralization bug, so I shouldn't expect Jeff coming to my house with a giant "S", right?
2
votes
0answers
175 views

Snippet console.log() return different value than browser console

Not sure why the console.log() in my snippet return different value of the browser developer console : You could see that it return an empty array [] instead of filled one like console below. The ...
4
votes
0answers
53 views

Add support for Stack Snippets on the iOS app

When I view a post including a Stack Snippet, there is no ability to "run" the snippet like on the website. On the app: On the mobile site:
3
votes
0answers
38 views

Bug in Tidy in Snippet

In simple words, when there's a code like this: <img src="http://127.0.0.1/wp/wp-content/uploads/2016/06/PreviousArrowsLikeACatPagenJewelryPentagramsSilverWiccanNecklaceBracelet.png" alt="...
15
votes
9answers
261 views

Stack Snippets Upgrade: new UI

Good news for those who love Stack Snippets (and also for those who don't, but use it anyway). We improved the user experience and UI to: Create visual hierarchy (AKA "easy to use") in the editor ...
6
votes
1answer
54 views

Snippet body is partially clipped/obscured in the snippet editor [closed]

Stack Snippets on SO apparently got some CSS changes (at least), which unfortunately cause part of the snippet body to be clipped/obscured in the snippet editor, at least on Chrome (v51.0.2704.79 on ...
4
votes
1answer
77 views

Define custom console logging for all Node objects

Currently, the virtual console defines a custom logging for HTMLElement objects, e.g. console.log(document.body); However, not all Element objects are HTMLElement, e.g. console.log(...
3
votes
0answers
36 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 ...
2
votes
1answer
154 views

Stop iterating objects using __proto__

http://stacksnippets.net/scripts/snippet-javascript-console.js uses this function function getProps(obj) { var props = []; do { for (var prop in obj) { if (props.indexOf(...
61
votes
12answers
828 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 ...
3
votes
1answer
194 views

NoScript XSS protection for code snippets

The feature: The text editor allows code snippets to be submitted as a sandbox like JSFiddle. I'm referring to the button that reads: JavaScript/HTML/CSS snippet Ctrl-M ...rather than: Code ...
-3
votes
1answer
62 views

Remove Stack Snippets on Meta Stackexchange

Stack snippets are available on this meta.stackexchange.com site, but as mentioned in the initial meta post about them there was no discussion as to whether they should be here or not. I would ...
1
vote
0answers
30 views

Snippet editor pushed partly offscreen when developer tools side panel opened

I frequently find myself in the situation where I start editing a Stack Snippet, then open developer tools, which I like to have anchored on the right of the browser window. As soon as I do this, it ...
11
votes
0answers
66 views

Add option to search posts with 'Stack Snippets'

Read this first: How to make use of the "Stack Snippets" more intuitive to new users? Clearly is a problem that will not be resolved anytime soon, but I have a suggestion that may help to ...
8
votes
0answers
109 views

Humble design suggestion for Stack Snippets: de-emphasize “Copy to answer” button

I am absolutely, no doubt about it, not a designer. That said, what do you think about: In my mind drawing the "Copy snippet to answer" link less primary is prettier: It draws attention to the main ...
-3
votes
1answer
101 views

Bug in Stack Exchange Code Snippet [duplicate]

I found a bug today in Stack Exchange's Code Snippet. Kindly check this. While inserting code snippet, this happens: Please try to solve this. Note: I am not exactly sure how to recreate. It ...
7
votes
0answers
29 views

JavaScript snippet containing multiple dollar signs is corrupted [duplicate]

As part of https://codegolf.meta.stackexchange.com/a/7848/163, I posted a stack snippet that uses jQuery and ran into a problem. Take for example the following snippet: !-- begin snippet: js hide: ...
1
vote
0answers
16 views

Code snippet error display [duplicate]

I am glad to use the StackCodeSnippet on the site. Just a few question aroses in me. Should a snippet like this display error messages, as my Browser debugger (as in the one pressing F12) does? I ...
2
votes
0answers
54 views

Allow framing of links to current site in stack snippets

Over at PPCG.SE (CodeGolf.SE), we regularly use stack snippets for leaderboards for our programming challenges. However, the snippets feature prevents our leaderboards from having links to the answers....
33
votes
1answer
790 views

CORS for stack.imgur?

Every now and then I happen to come across JS questions that involve canvases and images in some way. When attempting to answer, I usually create a runnable snippet. Now, because of same-origin-policy,...
15
votes
1answer
97 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 ...