bashup / mdsh

Multi-lingual, Markdown-based Literate Programming... in run-anywhere bash
MIT License
185 stars 15 forks source link

Parse mixed-length code fences and whitespace #1

Closed pjeby closed 7 years ago

pjeby commented 7 years ago

Commonmark allows code fences to have more than three backquotes or tildes, and to be prefixed by up to three spaces. While mdsh should still only respond to unindented blocks with exactly 3 backquotes, it should parse other types of code fences, ignoring triple-backquote lines inside them, and not be fooled by false block endings.

In other words, the parser should recognize and parse all types of Commonmark fenced code blocks, even if it only compiles the unindented triple-backquoted ones. (And whitespace at the start of the language tag should be stripped.)