I inserted a properly formatted code in SO. Which you can see in the preview just below the input box (refer image below). However, the application will not let me submit my post stating that there is something wrong with the code formatting. Please refer the image below. SO Post link
-
5Perhaps it thinks that the header line before the code block should also be indented?– jonrsharpeJul 2, 2015 at 12:55
-
14Indeed. Use a line between code and header.– Patrick HofmanJul 2, 2015 at 12:59
-
1Aaaah! That's the problem!! Thank you jonrsharpe and @PatrickHofman, however, the line before did not have to be intended but there had to be a line space, thank you very much that solved it :)– LordbalmonJul 2, 2015 at 13:01
-
Nice bug, even if there is a good workaround.– DeduplicatorJul 2, 2015 at 16:04
-
5Actually, is not a bug @Deduplicator, as CommonMark would require a empty line after the header. spec.commonmark.org/dingus/…– BraiamJul 2, 2015 at 17:32
-
@Braiam: The bug isn't in the quality-filter then, but the markdown renderer, you say? Still a bug, because they don't agree.– DeduplicatorJul 2, 2015 at 17:37
-
@Deduplicator indeed, the preview is in the wrong.– BraiamJul 2, 2015 at 18:12
-
1It is a bug. An empty line is required, but the renderer assumes that you intended to have one, while the checker reports it as bad markdown. This would be ridiculously for me, I can't even imagine what it'd be like to ask your first question on S/O and be faced with that.– Anubian NoobJul 4, 2015 at 13:47
1 Answer
You are experiencing Undefined Behaviour :-)
As said by jonrsharpe and PatrickHofman, you shall have a blank line above indented code. As you did not have it, things went bad :
- the quality filter correctly noticed that your source text was incorrect
- the renderer correctly guessed that you intended to have the blank line, and cleverly did as if it had been there
I would not call it a bug : when source is correct, it must be rendered correctly. But nothing forbids the renderer to do its best to interpret incorrect source. And even if it was nicely rendered, it is not correct.
-
6Hi @SergeBallesta. Bugs are like weeds, any unintended behavior is a bug. Neither the markdown guide on SO (refer stackoverflow.com/editing-help) nor the error message in the picture notified the user about the new line, hence it is a bug unless either the document or the error message is modified Jul 2, 2015 at 18:33
-
5It doesn't matter whether the markdown spec is loose in this case, it just means you cannot prove a bug if only looking at any of preview, serverside-rendering and other ways posts are interpreted by SE in isolation: The SE engine not being self-consistent is consistently classified a bug. Jul 2, 2015 at 19:23