russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.43k stars 597 forks source link

GitHub released a formal spec for GitHub Flavored Markdown, based on top of CommonMark. #341

Open dmitshur opened 7 years ago

dmitshur commented 7 years ago

Announcement: https://github.com/blog/2333-a-formal-spec-for-github-flavored-markdown. Full Details: https://githubengineering.com/a-formal-spec-for-github-markdown/.

Highlights:

This is a good validation of our goal of supporting CommonMark. /cc @rtfb

The reference implementation is good to be aware of, and can come in handy.

The formal specification of GFM-specific extensions can be helpful for github_flavored_markdown renderer.

russross commented 7 years ago

Markdown was created by John Gruber, who published his perl implementation and written documentation. This (with some minor updates) is the only official version of Markdown he ever published, and to this date it is the official standard for Markdown.

Unfortunately, it is an occasionally-ambiguous standard, and it does not include many of the common extensions that people have come to expect. CommonMark and GitHub Flavored Markdown are efforts to define Markdown more precisely and to modernize it somewhat (Gruber has not published an update since 2004, and seems to have little interest in doing so in the future or blessing anyone else's efforts).

So I guess you could say that everything other than the original Markdown implementation would be examples of the xkcd comic at work, but (as is usually the case when that xkcd is cited) progress is sorely needed.

I am not sure where the v1.0.3 test suite came from originally. We inherited it from Sundown (the C library that blackfriday was originally based on), and I think they took it from a PHP library. It is basically just a series of test cases that are processed, and the output compared with that of the official Gruber implementation.

Basically, CommonMark is the closest thing we have to a modern standard, but even it is fairly conservative with extensions (hence Github Flavored Markdown). It is a better starting point than the 2004 Gruber version (which has some problems from an implementation perspective), but there are some political reasons why Gruber will probably never recognize CommonMark and throw his weight behind it.

sirnewton01 commented 6 years ago

Hi, I'm wondering if there are any statements for this project as to the flavour of Markdown that the project supports (or maybe its own flavour) now or aims to support in the future. I'm hoping that it is aiming for compatibility with the new CommonMark specification with extensions, but it would be good to have a statement one way or another. Thank you.

skyzyx commented 6 years ago

I, also, am extremely interested in seeing the Commonmark-based GFM spec implemented. Most notably, code-fenced blocks as a child of list items.