CommonMark

from Wikipedia, the free encyclopedia
CommonMark
Markdown-mark.svg
File extension : no
Developed by: John MacFarlane , David Greenspan , Vicent Marti , Neil Williams , Benjamin Dumke-von Marriage , Jeff Atwood
Initial release: 5th September 2014
Type: Simplified markup language
Website : http://commonmark.org/

CommonMark is a simplified markup language that was developed by a small group of developers led by John MacFarlane and Jeff Atwood in an attempt to eliminate the ambiguity in parsing Markdown so that different parsers that conform to the specification produce the same result.

history

Markdown, which is used to write articles on Stack Overflow and GitHub , can easily lead to confusion - mainly due to the following three properties:

  • URLs are not automatically converted to hyperlinks. Instead, they must be explicitly identified.
  • The underscore (_) for formatting _ italic_ and __bold__ text also applies within a word, which can lead to unexpected side effects, for example in expressions such as "a_file" and "another_file" (unexpected result: " another file").
  • Markdown is based on paragraphs, not lines. Line end marks (CR / LF) are not automatically converted to line breaks. One or more blank lines are required for a paragraph.

In late 2012, David Greenspan and Jeff Atwood started a new project to create an official Markdown specification, the various implementations of which can be validated using a standard test suite. This was intended to further promote Markdown's popularity rather than continuing the fragmentation of the language.

In September 2014, a first draft of the syntax was published under the name "Standard Markdown". After a violent reaction from the Markdown inventor John Gruber on Twitter and a subsequent discussion with those responsible behind the project, an agreement was finally reached on the name CommonMark.

In March 2017, GitHub published a specification for its own Markdown dialect, which is based on CommonMark, and switched to a new implementation. Shortly thereafter, the forum software Discourse was also converted to a new CommonMark-compliant implementation of Markdown, which includes some extensions.

Differences from Markdown

Below are some of the differences between Markdown and CommonMark.

Award element Markdown CommonMark
Nested lists Markdown here only stipulates four spaces for subsequent paragraphs belonging to a point. How many are required for a nested list is not explicitly regulated and has so far been handled differently in different implementations.

Example:

- foo
    - bar
   - baz
In CommonMark, a nested list must be indented by as many characters as a paragraph would have to be to belong to the list.

Example:

- foo
  - bar
    - baz
Empty line in front of headings and blocks Most implementations do not require a blank line, which leads to ambiguities in the evaluation. A blank line ends a block
Blank line in front of indented source code Required by some implementations, but not mentioned anywhere in the documentation A blank line is required to define a new block. The source code is indented by four characters.

For example:

Funktion:
    int test(void) {
        return 42;
    }

Individual evidence

  1. Jeff Atwood: Responsible Open Source Code Parenting. Coding Horror: Programming and Human Factors. December 29, 2009, accessed September 12, 2014 .
  2. Julia Schmidt: Initiative tries to standard markdown. heise developer. September 4, 2014, accessed September 12, 2014 .
  3. Julia Schmidt: Standard Markdown renamed CommonMark. heise developer. September 8, 2014, accessed September 12, 2014 .
  4. Julia Schmidt: GitHub presents its own, CommonMark-compliant Markdown specification. heise developer. March 15, 2017. Retrieved May 28, 2018 .
  5. Sam Saffron: Discourse CommonMark migration plans. Discourse Meta. June 9, 2017, accessed May 29, 2018 .

Web links