I can't get code to post in a question - it "appears" there is unformatted code but there is not

Viewed 2075

I have spent almost two hours creating a new question, trying to provide helpful information and code - I couldn't use a code sandbox because sqlalchemy and flask are not available on codesandbox.com as dependencies.

When I get to the "review" step of my post, I get an error that says:

Your post appears to contain code that is not properly formatted as 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.

Of course the key word here is "appears". There are about a half-dozen code blocks but they're all formatted correctly. I've tried using three tick fences, tried using control-k to format the 4 spaces, tried using both methods together, and I keep getting the error. There's not enough detail in the error to tell exactly where the stackoverflow code thinks there is unformatted code.

Any suggestions on how to get past this error?

2 Answers

Solution was that there was an error message that I put in a blockquote - after all, it wasn't code; it was an error message. The stackoverflow code interpreted the error message as code. I changed it from a blockquote block to a code block and it appears I could post the message now - but now I'm up against a limit that I can only post once in 90 minutes so this question is blocking me from posting the real question.

Just a suggestion to the admins: blockquoted segments should not be checked by the code validator.

Related to OP's answer, it is also possible to format code blocks inside a blockquote.

For example:

> ```
> > code
> * errors
> - logs
> ```

gets rendered as:

> code
* errors
- logs
Related