Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active August 19, 2018 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YumaInaura/dd121a0a0d4de98746cf000a6f4dd22c to your computer and use it in GitHub Desktop.
Save YumaInaura/dd121a0a0d4de98746cf000a6f4dd22c to your computer and use it in GitHub Desktop.
Markdown - Actually 3 backticks "fenced codeblock" is extended syntax ( Thank you Robin Dupret @robin850 )

Markdown - Actually 3 backticks "fenced codeblock" is extended syntax

I noticed to A Markdown parser created by ruby library ( called "gem" ) could not parser fenced code block.

But i knew now code block is not supported original Markdown syntax. It was so surprising to me.

Extended markdown syntax

ref

4 spaces code block is basic syntax.

The basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab. If you find that inconvenient, try using fenced code blocks. Depending on your Markdown processor or editor, you’ll use three tick marks (```) or three tildes (~~~) on the lines before and after the code block.

Extended Syntax | Markdown Guide

( table is also extended syntax )

I remembered Stackoverflow let us describe "four space indenting" for use code block. I've wondered "what a unuseful syntax is it".

But now I got a sense.

In my opinion

I like extended Markdown syntax (3 bucticks code block is so useful)

Github Issue for ruby gem ( redcarpet )

Can not parse well Markdown syntax in code block · Issue #659 · vmg/redcarpet

Response

Actually you need to enable the fenced_code_blocks option; this syntax is not supported by original Markdown, so you should rather write:

Thank you robin850 (Robin Dupret) !

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment