RSS Amplifier

Recent Questions - Code Review Meta Stack Exchange · Apr 13, 2019

Fenced code blocks don't close properly at the end of a post

0
Sign in to vote or save

This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.

The new feature, GitHub (tilde) code blocks, from Implement ```-style (fenced) Markdown code blocks is a great addition, but there is a small bug which bizarrely only appears on Code Review & Code Review Meta. If a code block contains a blank line anywhere, and the closing ``` isn't followed by a newline, it will be taken as code rather than a closing fence. The bug applies to both the previews of…

The new feature, GitHub (tilde) code blocks, from Implement ```-style (fenced) Markdown code blocks is a great addition, but there is a small bug which bizarrely only appears on Code Review & Code Review Meta. If a code block contains a blank line anywhere, and the closing ``` isn't followed by a newline, it will be taken as code rather than a closing fence.

The bug applies to both the previews of the posted content. It can be worked around easily enough by finishing the post with a newline but is unexpected. The source of the problem seems to be due to MathJax.

This can result in accidental noise in any code block at the end of a post:

some code

more code but there was a blank line above
```

Read on codereview.meta.stackexchange.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.