jgm / djot

A light markup language
https://djot.net
MIT License
1.71k stars 43 forks source link

Clarify whitespace before and after language specifier #154

Closed MarkLodato closed 1 year ago

MarkLodato commented 1 year ago

The spec currently reads (emphasis added):

A code block starts with a line of three or more consecutive backticks, optionally followed by whitespace and a language specifier, but nothing else.

This incorrectly implies:

I was confused because this would be difference from GitHub Flavored Markdown and was wondering the rationale behind the change. When I tried it in the playground, I saw that whitespace around the language specifier is ignored.

I suggest something like:

A code block starts with a line of three or more consecutive backticks, optionally followed a language specifier, but nothing else. The language specifier may optionally be preceded and/or followed by whitespace.

I'm happy to send a PR if you agree.

jgm commented 1 year ago

Sounds good to me. If you do a PR, do make doc/syntax.html to compile the HTML version.