16

Every day I fix up numerous questions that have multi-line code blocks enclosed in single backticks rather than triple backtick code fences. Or they don't put a newline between the triple backticks and the code. These are treated as inline code, so the lines are wrapped and the code is impossible to read.

Can the New Question wizard check for this and warn the poster?

I also think we should warn about very long inline code, even if they aren't multi-line. I think anything longer than around 20 characters should be done as code blocks rather than inline code.

It seems like this is happening very frequently these days. Is there something in the wizard that's making it easy to add code like this? A few months ago we had the frequent problem of nested triple and single backticks; I don't see that very much now, is this new problem due to the "fix" for that?

5
  • 2
    The new editor (the wizard uses it) has an inline code button and a code block button both of which look very similar. Using it in the markdown mode might trick users not familiar with markdown. Aug 18 at 5:43
  • 2
    Support for the 1st part, but about "I think anything longer than around 20 characters should be done as code blocks rather than inline code.", I find 20_characters is_very_short...!
    – chivracq
    Aug 18 at 9:01
  • So perhaps say... 150 characters then.
    – Gimby
    Aug 18 at 12:14
  • Re "they don't put a newline between the triple backticks and the code": An example Aug 18 at 15:00
  • 1
    @chivracq Perhaps, but what I'd like to discourage is people putting shell command lines into inline markdown. command1 | command2 | command3 should be a code block, not inline. Definitely anything long enough to cause line wrap should not be inline.
    – Barmar
    Aug 18 at 15:29

0

You must log in to answer this question.