3

Right now, when there's a link from JSFiddle.net in a post you are required to have a code-block, otherwise you'll get an error which won't let you submit your post/edit:

Links to jsfiddle.net must be accompanied by code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

It's been discussed here: Detect (disallow?) fiddle links in code blocks

There are many other threads here:

  1. Asking to allow posting fiddle links without code (Answer: Then you have a "Link-Only" answer or "No MCVE" question which would get downvoted and probably deleted as NAA or closed)

  2. Talking about users hacking the system by putting the link into a code block, using shortened URLs, etc. (Answer: We can only try to let users know that links to external resources without enough details provided are not useful. If they decide to hack the system, there's not much else we can do except taking the regular moderation actions when we see those posts).


This is appropriate if you are the author of the fiddle. But if you are not, another issue surfaces. According to May I edit a question with a JSFiddle link to incorporate the code? you shall not copy/paste content of JSFiddle.net posts into Stack Exchange. It suggests leaving a comment and asking OP to include their code themselves but again, that's only valid if they are also author of the fiddle.

Take this Answer to: Highcharts view data table is showing incorrect data.

I first edited to improve the layout. Doing that I was required to include the code so I copy/pasted the fiddle; upon further research I realized that is not appropriate so I rolled back and included an empty block of code to bypass the error. I did not ask the OP to include the code since they are not author of the fiddle.

At the same time, I don't think that the answer needs to go away as link-only. It says: "You can work around this issue by setting missing data to an empty array ..." which is practically an answer. However it did not include a link to the source, which I added.

My questions are:

  • Have I acted appropriately here? If not, what would have been the better approach?
  • If you are referring to someone else's work on JSFiddle, then how you can keep up with the standard of posting the code while complying with the licensing requirements?

If I am on the right path, then I am thinking of some changes to that feature:

  • When other users are editing, a notification/warning happens rather than blocking, if the text for the JSFiddle link already existed in the post. The issue is that we don't want users adding such links, not that we don't want them to improve posts where it already exists.
  • As suggested in other threads, the message about including code should change to better reflect what Stack Exchange requires.
2
  • 1
    Ah, that regex is stupid. I added a space in the JSFiddle link.
    – S.S. Anne
    Commented Mar 18, 2020 at 22:13
  • 1
    @S.S.Anne I've removed the https.
    – Cœur
    Commented Mar 19, 2020 at 15:53

1 Answer 1

5

The issue of having to add something as code is a unique issue with an always decreasing amount of posts where the issue you encountered applies: e.g. posts with JSFiddle links that did not include code and that were made before the regex rule was put in place. Eventually we may see a day where no one will encounter that exact issue anymore.

As for your two questions:

Have I acted appropriately here? If not, what would be the better approach?

Ultimately, yes, you did the right thing. Your original edit that added substantive JSFiddle code was incorrect for the reason you mention. In cases where a JSFiddle demo has only boilerplate code or only a few lines, or even mentions an appropriately permissive license in one of the code panels, you can copy that code without concern to Stack Overflow. However, in this case there's a substantial amount of code so it's inappropriate for anyone other than the author to paste it.

On that note, however, you're also right that it's not a link-only answer because it does mention the crux of the solution:

You can work around this issue by setting missing data to an empty array.

While this isn't a stellar answer, it is an answer.


As for your second question:

If you are referring to someone else's work on JSFiddle, then how you can keep up with the standard of posting the code while complying with the licensing requirements?

You can't, unless one of the conditions I mentioned earlier in my answer is met, or if you are able to contact the author and get their permission. However, the best we can do is ask that those who post links to JSFiddle also post the code from JSFiddle into the answer. There's little we can do to determine whether the poster on Stack Overflow is the same as the author of the JSFiddle, especially since usernames and avatars on Stack Overflow do not have to be unique.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .