Markdown Parsing of Code Blocks

This is a gotcha that falls into the minor nuisance category.

Here is a picture that displays the symptom. The three back ticks signalling the end of a code block are displayed.

codeblock display

The picture belows shows that the line with the three back ticks also contains a trailing space character.

code block code

Removing the space character corrects the problem and the display is correct.

code display correct

I’m not sure I would call this a bug, per se. Trailing spaces are sometimes significant in Markdown, so they can’t be routinely ignored or stripped. And the syntax for fenced code blocks (although not part of the original Markdown syntax) generally specifies they must appear on a line by themselves. So, with the extra space, they are no longer on the line by themselves.

1 Like