An example of the bug is shown in the screenshot below, which occurred while editing this answer:

screenshot of bug

The issue goes away if a trailing line break is added.

A minimal reproduction of the bug:

  • Ask on Code Golf
  • Enter "```\ncode\n\nmore\n```" so the input field looks like:
    more code ```
  • 2
    I thought maybe the trailing line break was mandatory in CommonMark but that doesn't seem the case: spec.commonmark.org/0.29/#code-fence
    – rene
    Dec 28, 2020 at 11:29
  • @rene One could rightfully claim that a non-empty document without a trailing line break isn't POSIX compliant…
    – Adám
    Dec 28, 2020 at 11:31
  • I tried reproducing this bug in the formatting sandbox, but I didn't manage to reproduce it. Dec 28, 2020 at 11:36
  • 1
    @DonaldDuck Right, I also tried reproducing it here in the post itself, but couldn't. However, if you ask a question on the Code Golf site and type in "```\ncode\n\nmore\n```" it will manifest.
    – Adám
    Dec 28, 2020 at 11:53
  • 1
    I'm only able to reproduce if the top line of the code block is empty; if the line immediately after the one with the first triple backtick has text in it, it goes away. Also, I'm unable to reproduce this on most sites, only on Code Golf. Dec 28, 2020 at 12:03
  • 1
    @SonictheCuriouserHedgehog So you don't see this?
    – Adám
    Dec 28, 2020 at 12:06
  • 1
    Reproduced on Code Review, we encounter this every so often. Adding an extra newline helps.
    – Mast
    Apr 24, 2022 at 17:42


You must log in to answer this question.

Browse other questions tagged .