34

Every day I fix up lots of questions where the poster has written their code blocks like this:

```<html>
blah
blah
</html>```

When they do this, the first line of the code is not included in the code block.

I think it may be because below the editor there's a key that looks like this:

enter image description here

It shows the code on the same line as the backticks. That's correct for inline code, but not for code blocks.

I'm not sure exactly what to suggest instead, but that simple key is leading many posters down the wrong path, so we need something better. I know there's more detailed formatting help in the documentation, but they're not going there.

I just noticed that while I'm editing this question, there's a sidebar that shows the correct way to enter code between backticks. But in the main SO site, that's been replaced by more "wizardy" guidelines.

5
  • 2
    I'm not sure exactly what to suggest instead - the catch-all no effort (no effort to fix existing content that is) solution in my eyes is to make the example snippet actually work. Fix the parser.
    – Gimby
    Commented Nov 19, 2019 at 9:20
  • 3
    And inline code shouldn't be using triple backticks anyway, just single backticks.
    – TylerH
    Commented Nov 19, 2019 at 14:43
  • 1
    @Gimby The minor problem with that is there's already meaning for text on the same line as the first triple backtick -- you can put the language there. That's why it's not shown.
    – Barmar
    Commented Nov 19, 2019 at 17:10
  • What kind of questions are you spending the time on? Questions you answer? Commented Nov 19, 2019 at 18:05
  • 2
    I frequently just try to fix up the formatting of questions that I read, even if I decide not to answer them.
    – Barmar
    Commented Nov 19, 2019 at 18:06

0

You must log in to answer this question.

Browse other questions tagged .