admin管理员组

文章数量:1323192

The problem with writing my own Markdown parser in Clojure is that Markdown is not a well-specified language. There is no "official" grammar, just an informal "Here's how it works" description and a really ugly reference implementation in Perl. /

I can see Gruber's specification here and the implementation here.

This is an implementation that wins the google ranking test here

Then there is peg-markdown which appears to solve the 'there is no grammar' problem - but is not the canonical implementation.

My question is - what is the canonical implementation of markdown? (The one that everybody says defines the standard).

EDIT:

I acknowledge that "there is no canonical standard". I'm looking for the next best thing.

The answer seems to be showdown.js, but there are problems with it.

(using the definition of canonical being the one that everybody says defines the standard).

It gets referenced here and on github here.

I'll throw in pagedown as well (as aluded to by @deceze) because it appears to fix the bugs in showdown and be a little closer to Gruber's original.

The problem with writing my own Markdown parser in Clojure is that Markdown is not a well-specified language. There is no "official" grammar, just an informal "Here's how it works" description and a really ugly reference implementation in Perl. http://briancarper/blog/415/

I can see Gruber's specification here and the implementation here.

This is an implementation that wins the google ranking test here

Then there is peg-markdown which appears to solve the 'there is no grammar' problem - but is not the canonical implementation.

My question is - what is the canonical implementation of markdown? (The one that everybody says defines the standard).

EDIT:

I acknowledge that "there is no canonical standard". I'm looking for the next best thing.

The answer seems to be showdown.js, but there are problems with it.

(using the definition of canonical being the one that everybody says defines the standard).

It gets referenced here and on github here.

I'll throw in pagedown as well (as aluded to by @deceze) because it appears to fix the bugs in showdown and be a little closer to Gruber's original.

Share Improve this question edited May 23, 2017 at 11:53 CommunityBot 11 silver badge asked Sep 5, 2011 at 11:37 hawkeyehawkeye 35.8k35 gold badges159 silver badges314 bronze badges 2
  • 1 Also see six.pairlist/mailman/listinfo/markdown-discuss – daxim Commented Sep 5, 2011 at 12:13
  • 1 Also see codinghorror./blog/2009/12/… (Which is to say that the answer is most likely pretty much None.) – deceze Commented Sep 5, 2011 at 12:17
Add a ment  | 

2 Answers 2

Reset to default 6

I believe Gruber's is the original and sort-of-canonical (see, for example, his 'Introducing Markdown'), and then people have extended it from there. I think some extensions are more mon than others though, so it's probably worth seeing what a few well-used packages have over his original.

The CommonMark project attempts to address some of the issues of the Markdown specification, in particular some ambiguities. It es with a reference implementation, but that's obviously just the reference implementation for CommonMark, not for Markdown in general. It may bee the de-facto standard in years to e, since some major users are involved in that project, but it might as well bee just another dialect among many, in which case the reference implementation would add little value.

本文标签: javascriptWhat is the canonical implementation of markdownStack Overflow