-4

I edited a question on Stack Overflow adding a jsFiddle link to a sample fragment. Stack Overflow said:

Links to jsfiddle.net must be accompanied by code

So I added:

```  
... my code fragment from jsfiddle  
```

Stack Overflow did not like it until I changed it to a four space indented code block.

This looks like a bug.

Steps I took:

  1. Added the question without the jsFiddle link
  2. Edited the question and added the link
  3. Added a code block (delimited by a line of three backticks above and below)
  4. Stack Overflow complained
  5. Changed to 4-space indent
  6. Stack Overflow did not complain any more.
9

This looks like a bug.

Well, no, Stack Exchange doesn't support the GitHub-style code block extension to Markdown (and doesn't claim to anywhere), so this is .

That said, fenced code blocks are under consideration and may be allowed in the future.

  • SO supports backquote-code (inline and block). I mean that they work. What do you mean with: "doesn't support" and "may be allowed"? – Gabriel Petrovay Jul 22 '13 at 21:14
  • 1
    No, block level backtick code is not supported. Inline backtick code spans are supported, because they're natively part of markdown. Being able to fence your code with ``` is a GitHub extension that SO does not currently support. If you try and do it on SO now, you just get a funky code span. – Tim Stone Jul 22 '13 at 21:18
  • In the question body above … my code fragment from jsfiddle is written between ```. Why do you say this feature is not supported? Is it because it is not syntax-colored? – Gabriel Petrovay Jul 22 '13 at 21:21
  • 1
    That's one way of looking at it. Your text is in a code span there, not a code block like the one you'd get on GitHub, or on SO by indenting four spaces, and the edit check looking for accompanying code cares about the presence of a code block. – Tim Stone Jul 22 '13 at 21:23
  • When should one use <code> and when a "code block" on SO questions? – Gabriel Petrovay Jul 22 '13 at 21:25
  • 2
    @GabrielPetrovay Never, for a <code> tag. Use four spaces for indenting a code block, or a single backtick for inline code. There no reason to ever use a literal <code> tag. Read the markdown editing help already! – meagar Jul 22 '13 at 21:30
  • @meagar <code> == ```. So, the question was: When should one use 3 x backquote? Answer here: meta.stackexchange.com/questions/189920/… – Gabriel Petrovay Jul 22 '13 at 21:50
  • @GabrielPetrovay No, they're not equivalent. You can type a literal <code> tag, and that's what is implied when you say "<code>". If you want to say ``` then say ```. – meagar Jul 23 '13 at 2:42

You must log in to answer this question.

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