Markdown Explained
Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as an easy-to-read markup language. Markdown is widely used for blogging and instant messaging, and also used elsewhere in online forums, collaborative software, documentation pages, and readme files.
The initial description of Markdown[8] contained ambiguities and raised unanswered questions, causing implementations to both intentionally and accidentally diverge from the original version. This was addressed in 2014 when long-standing Markdown contributors released CommonMark, an unambiguous specification and test suite for Markdown.
History
Markdown was inspired by pre-existing conventions for marking up plain text in email and usenet posts, such as the earlier markup languages setext, Textile (c. 2002), and reStructuredText (c. 2002).
In 2002 Aaron Swartz created atx and referred to it as "the true structured text format". Gruber created the Markdown language in 2004 with Swartz as his "sounding board."[9] The goal of the language was to enable people "to write using an easy-to-read and easy-to-write plain text format, optionally convert it to structurally valid XHTML (or HTML)."[10]
Another key design goal was readability, that the language be readable as-is, without looking like it has been marked up with tags or formatting instructions, unlike text formatted with 'heavier' markup languages, such as Rich Text Format (RTF), HTML, or even wikitext (each of which have obvious in-line tags and formatting instructions which can make the text more difficult for humans to read).
Gruber wrote a Perl script,, which converts marked-up text input to valid, well-formed XHTML or HTML and replaces angle brackets and ampersands with their corresponding character entity references. It can take the role of a standalone script, a plugin for Blosxom or a Movable Type, or of a text filter for BBEdit.
Rise and divergence
As Markdown's popularity grew rapidly, many Markdown implementations appeared, driven mostly by the need for additional features such as tables, footnotes, definition lists,[11] and Markdown inside HTML blocks.
The behavior of some of these diverged from the reference implementation, as Markdown was only characterised by an informal specification[12] and a Perl implementation for conversion to HTML.
At the same time, a number of ambiguities in the informal specification had attracted attention.[13] These issues spurred the creation of tools such as Babelmark[14] [15] to compare the output of various implementations,[16] and an effort by some developers of Markdown parsers for standardisation. However, Gruber has argued that complete standardization would be a mistake: "Different sites (and people) have different needs. No one syntax would make all happy."[17]
Gruber avoided using curly braces in Markdown to unofficially reserve them for implementation-specific extensions.[18]
Standardization
CommonMark |
Noextcode: | on |
Extensions: | .md , .markdown |
Nomimecode: | on |
Mime: | text/markdown; variant=CommonMark |
Uniform Type: | uncertain[19] |
Conforms To: | public.plain-text |
Owner: | John MacFarlane, open source |
Latest Release Version: | 0.31.2 |
Latest Release Date: | [20] |
Genre: | Markup language |
Extended From: | Markdown |
Extended To: | GitHub Flavored Markdown |
Type: | Open file format |
From 2012, a group of people, including Jeff Atwood and John MacFarlane, launched what Atwood characterised as a standardisation effort.[21]
A community website now aims to "document various tools and resources available to document authors and developers, as well as implementors of the various Markdown implementations".[22]
In September 2014, Gruber objected to the usage of "Markdown" in the name of this effort and it was rebranded as CommonMark.[23] [24] CommonMark.org published several versions of a specification, reference implementation, test suite, and "[plans] to announce a finalized 1.0 spec and test suite in 2019."[25]
No 1.0 spec has since been released as major issues still remain unsolved.[26]
Nonetheless, the following websites and projects have adopted CommonMark: Discourse, GitHub, GitLab, Reddit, Qt, Stack Exchange (Stack Overflow), and Swift.
In March 2016, two relevant informational Internet RFCs were published:
- introduced MIME type .
- discussed and registered the variants MultiMarkdown, GitHub Flavored Markdown (GFM), Pandoc, and Markdown Extra among others.[27]
Variants
Websites like Bitbucket, Diaspora, GitHub,[28] OpenStreetMap, Reddit,[29] SourceForge[30] and Stack Exchange[31] use variants of Markdown to make discussions between users easier.
Depending on implementation, basic inline HTML tags may be supported.[32]
Italic text may be implemented by _underscores_
or *single-asterisks*
.[33]
GitHub Flavored Markdown
GitHub had been using its own variant of Markdown since as early as 2009,[34] which added support for additional formatting such as tables and nesting block content inside list elements, as well as GitHub-specific features such as auto-linking references to commits, issues, usernames, etc.
In 2017, GitHub released a formal specification of its GitHub Flavored Markdown (GFM) that is based on CommonMark. It is a strict superset of CommonMark, following its specification exactly except for tables, strikethrough, autolinks and task lists, which GFM adds as extensions.[35]
Accordingly, GitHub also changed the parser used on their sites, which required that some documents be changed. For instance, GFM now requires that the hash symbol that creates a heading be separated from the heading text by a space character.
Markdown Extra
Markdown Extra is a lightweight markup language based on Markdown implemented in PHP (originally), Python and Ruby.[36] It adds the following features that are not available with regular Markdown:
- Markdown markup inside HTML blocks
- Elements with id/class attribute
- "Fenced code blocks" that span multiple lines of code
- Tables[37]
- Definition lists
- Footnotes
- Abbreviations
Markdown Extra is supported in some content management systems such as Drupal,[38] Grav (CMS) and TYPO3.[39]
LiaScript
LiaScript[40] is a Markdown dialect that was designed to create interactive educational content. It is implemented in Elm and TypeScript and adds additional syntax elements to define features like:
Examples
Text using Markdown syntax | Corresponding HTML produced by a Markdown processor | Text viewed in a browser |
---|
Heading Sub-heading-----------
- Alternative heading
- Alternative sub-heading
Paragraphs are separated by a blank line.
Two spaces at the end of a line produce a line break.
| HeadingSub-heading
Alternative heading
Alternative sub-heading
Paragraphs are separatedby a blank line.
Two spaces at the end of a line produce a line break.
| Heading
Sub-heading
Alternative heading
Alternative sub-heading
Paragraphs are separatedby a blank line.
Two spaces at the end of a line produce a line break.
|
Text attributes _italic_, **bold**, `monospace`. Horizontal rule:
---
| Text attributes italic, bold, monospace . Horizontal rule:
| Text attributes italic, bold, monospace .Horizontal rule:
|
Bullet lists nested within numbered list: 1. fruits * apple * banana 2. vegetables - carrot - broccoli
| Bullet lists nested within numbered list: - fruits
- vegetables
| Bullet lists nested within numbered list:- fruits
- vegetables
|
A [link](http://example.com). | [Image](Icon-pictures.png "icon") > Markdown uses email-stylecharacters for blockquoting.>> Multiple paragraphs need to be prepended individually.
Most inline HTML tags are supported.
| A link. ![icon Image](Icon-pictures.png)
Markdown uses email-style characters for blockquoting. Multiple paragraphs need to be prepended individually.
Most inline HTML tags are supported.
| A link.Markdown uses email-style characters for blockquoting.
Multiple paragraphs need to be prepended individually.
Most inline HTML tags are supported.
|
---|
m | h | end --> | |
Implementations
Implementations of Markdown are available for over a dozen programming languages; in addition, many applications, platforms and frameworks support Markdown.[41] For example, Markdown plugins exist for every major blogging platform.
While Markdown is a minimal markup language and is read and edited with a normal text editor, there are specially designed editors that preview the files with styles, which are available for all major platforms. Many general-purpose text and code editors have syntax highlighting plugins for Markdown built into them or available as optional download. Editors may feature a side-by-side preview window or render the code directly in a WYSIWYG fashion.
Some apps, services and editors support Markdown as an editing format, including:
- Bugzilla uses a customized version of Markdown.[42]
- ChatGPT: Output from the LLM formatted in Markdown will be rendered in LaTeX and HTML by the ChatGPT client, and the model is encouraged to use Markdown to format its output. Markdown provided by the user will not be formatted by the client, but will still be passed to the model unaltered.
- Discord: chat messages[43]
- Discourse uses the CommonMark flavor of Markdown in the forum post composer.
- Doxygen: a source code documentation generator which supports Markdown with extra features[44]
- GitHub Flavored Markdown (GFM) ignores underscores in words, and adds syntax highlighting, task lists,[45] and tables
- The GNOME Evolution email client supports composing messages in Markdown format,[46] with the ability to send and render emails in pure Markdown format (
Content-Type: text/markdown;
) or to convert Markdown to plaintext or HTML email when sending.
- Joplin: a note-taking application that supports markdown formatting[47]
- JotterPad: an online WYSIWYG editor that supports Markdown and Fountain[48]
- Kanboard uses the standard Markdown syntax as its only formatting syntax for task descriptions.[49]
- Microsoft Azure DevOps' wiki feature supports both common Markdown conventions and GitHub Flavored Markdown[50]
- Microsoft Teams: chat messages[51]
- Misskey, its numerous forks and other Fediverse platforms such as Akkoma[52] use a custom text format misleadingly called "Misskey-Flavored Markdown (MFM)", with support for standard nestable block quotes
>
and inline emphasis _*`
as well as extensions seen elsewhere for @
mentions, #
tags, custom emoji :foo:
, automatic URL detection and toggleable link target preview, but no support for headings, lists, reference links and other standard Markdown features. It supports a handful of HTML-like tags (<small> <center> <plain>
) and a special notation with English keywords or key-value pairs $[''key=value'' ''content'']
for spans with stylistic effects applied, e.g. fonts, blurs, borders and transformations such as flipping, shifting, rotating, scaling and animation, but also for furigana and search boxes.[53] The message format of such ActivityPub objects that can be consumed as messages is text/x.misskeymarkdown
.
- The Mozilla Thunderbird email client supports Markdown through the "Markdown here Revival" add-on.
- Nextcloud Notes: the default app for taking notes on the Nextcloud platform supports formatting using Markdown[54]
- Obsidian is note-taking software based on Markdown files.[55]
- RMarkdown[56]
- RStudio: an IDE for R. It provides a C++ wrapper function for a markdown variant called sundown[57]
- Simplenote[58]
See also
External links
- for original John Gruber markup
Notes and References
- Web site: The Markdown File Extension . The Daring Fireball Company, LLC . 8 January 2014 . 27 March 2022 . Gruber, John . Too late now, I suppose, but the only file extension I would endorse is ".markdown", for the same reason offered by Hilton Lipschitz: We no longer live in a 8.3 world, so we should be using the most descriptive file extensions. It's sad that all our operating systems rely on this stupid convention instead of the better creator code or a metadata model, but great that they now support longer file extensions. . 12 July 2020 . https://web.archive.org/web/20200712120733/https://daringfireball.net/linked/2014/01/08/markdown-extension . live .
- The text/markdown Media Type . Internet Engineering Task Force . Request for Comments: 7763 . March 2016 . 27 March 2022 . Leonard, Sean . This document registers the text/markdown media type for use with Markdown, a family of plain-text formatting syntaxes that optionally can be converted to formal markup languages such as HTML. . 22 March 2022 . https://web.archive.org/web/20220322001232/https://datatracker.ietf.org/doc/html/rfc7763 . live .
- Web site: Markdown. 2004-03-19. Aaron Swartz: The Weblog. Aaron. Swartz. Aaron Swartz. 2013-09-01. 2017-12-24. https://web.archive.org/web/20171224200232/http://www.aaronsw.com/weblog/001189. live.
- Web site: Markdown. https://web.archive.org/web/20040311230924/https://daringfireball.net/projects/markdown/index.text . 2004-03-11 . Daring Fireball. John. Gruber. John Gruber . 2022-08-20.
- Guidance on Markdown: Design Philosophies, Stability Strategies, and Select Registrations . Internet Engineering Task Force . Request for Comments: 7764 . March 2016 . 27 March 2022 . Leonard, Sean . This document elaborates upon the text/markdown media type for use with Markdown, a family of plain-text formatting syntaxes that optionally can be converted to formal markup languages such as HTML. Background information, local storage strategies, and additional syntax registrations are supplied. . 17 April 2022 . https://web.archive.org/web/20220417115136/https://datatracker.ietf.org/doc/html/rfc7764 . live .
- Web site: RMarkdown Reference site. 2019-11-21. 2020-03-03. https://web.archive.org/web/20200303054734/https://rmarkdown.rstudio.com/. live.
- Web site: Markdown: License . Daring Fireball . 2014-04-25 . 2020-02-18 . https://web.archive.org/web/20200218183533/https://daringfireball.net/projects/markdown/license . live .
- Web site: Daring Fireball: Introducing Markdown. 2020-09-23. daringfireball.net. 2020-09-20. https://web.archive.org/web/20200920182442/https://daringfireball.net/2004/03/introducing_markdown. live.
- gruber . 741989829173510145 . I should write about it, but it’s painful. More or less: Aaron was my sounding board, my muse..
- Markdown 1.0.1 readme source code Web site: Daring Fireball – Markdown . 2004-12-17 . dead . https://web.archive.org/web/20040402182332/http://daringfireball.net/projects/markdown/ . 2004-04-02 .
- Technically HTML description lists
- Web site: Markdown Syntax Documentation. Daring Fireball. 2018-03-09. 2019-09-09. https://web.archive.org/web/20190909051956/https://daringfireball.net/projects/markdown/syntax. live.
- Web site: GitHub Flavored Markdown Spec – Why is a spec needed?. github.github.com. 2018-05-17. 2020-02-03. https://web.archive.org/web/20200203204734/https://github.github.com/gfm/#why-is-a-spec-needed-. live.
- Web site: Babelmark 2 – Compare markdown implementations . Johnmacfarlane.net . 2014-04-25 . 2017-07-18 . https://web.archive.org/web/20170718113552/http://johnmacfarlane.net/babelmark2/ . live .
- Web site: Babelmark 3 – Compare Markdown Implementations . github.io . 2017-12-10 . 2020-11-12 . https://web.archive.org/web/20201112043521/https://babelmark.github.io/ . live .
- Web site: Babelmark 2 – FAQ . Johnmacfarlane.net . 2014-04-25 . 2017-07-28 . https://web.archive.org/web/20170728115918/http://johnmacfarlane.net/babelmark2/faq.html . live .
- gruber. John Gruber. John. Gruber. 507670720886091776. 4 September 2014. @tobie @espadrine @comex @wycats Because different sites (and people) have different needs. No one syntax would make all happy..
- Web site: Markdoc . Gruber . John . 19 May 2022 . Daring Fireball . May 19, 2022 . I love their syntax extensions — very true to the spirit of Markdown. They use curly braces for their extensions; I'm not sure I ever made this clear, publicly, but I avoided using curly braces in Markdown itself — even though they are very tempting characters — to unofficially reserve them for implementation-specific extensions. Markdoc's extensive use of curly braces for its syntax is exactly the sort of thing I was thinking about. . 19 May 2022 . https://web.archive.org/web/20220519202920/https://daringfireball.net/linked/2022/05/19/markdoc . live .
- Web site: UTI of a CommonMark document. 12 April 2017. 29 September 2017. 22 November 2018. https://web.archive.org/web/20181122140119/https://talk.commonmark.org/t/uti-of-a-commonmark-document/2406. live.
- Web site: CommonMark specification . 2017-07-26 . 2017-08-07 . https://web.archive.org/web/20170807052756/http://spec.commonmark.org/ . live .
- Web site: Atwood . Jeff . The Future of Markdown . CodingHorror.com . 2012-10-25 . 2014-04-25 . 2014-02-11 . https://web.archive.org/web/20140211233513/http://www.codinghorror.com/blog/2012/10/the-future-of-markdown.html . dead .
- Web site: Markdown Community Page . GitHub . 2014-04-25 . 2020-10-26 . https://web.archive.org/web/20201026161924/http://markdown.github.io/ . live .
- Web site: Standard Markdown is now Common Markdown . 4 September 2014 . Jeff Atwood . 2014-10-07 . 2014-10-09 . https://web.archive.org/web/20141009181014/http://blog.codinghorror.com/standard-markdown-is-now-common-markdown/ . live .
- Web site: Standard Markdown Becomes Common Markdown then CommonMark . InfoQ . 2014-10-07 . 2020-09-30 . https://web.archive.org/web/20200930150521/https://www.infoq.com/news/2014/09/markdown-commonmark/ . live .
- Web site: CommonMark. en. 20 Jun 2018. " The current version of the CommonMark spec is complete, and quite robust after a year of public feedback … but not quite final. With your help, we plan to announce a finalized 1.0 spec and test suite in 2019.". 12 April 2016. https://web.archive.org/web/20160412211434/http://commonmark.org/. live.
- Web site: 2015-07-26. Issues we MUST resolve before 1.0 release [6 remaining]]. 2020-10-02. CommonMark Discussion. en-US. 2021-04-14. https://web.archive.org/web/20210414032229/https://talk.commonmark.org/t/issues-we-must-resolve-before-1-0-release-6-remaining/1287. live.
- Web site: Markdown Variants. IANA. 2016-03-28. 2016-07-06. 2020-10-27. https://web.archive.org/web/20201027005128/https://www.iana.org/assignments/markdown-variants/markdown-variants.xhtml. live.
- Web site: GitHub Flavored Markdown Spec. 2020-06-11. GitHub. 2020-02-03. https://web.archive.org/web/20200203204734/https://github.github.com/gfm/. live.
- Web site: Reddit markdown primer. Or, how do you do all that fancy formatting in your comments, anyway?. 2013-03-29. Reddit. 2019-06-11. https://web.archive.org/web/20190611185827/https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or_how_do_you_do_all_that/. live.
- Web site: SourceForge: Markdown Syntax Guide. 2013-05-10. SourceForge. 2019-06-13. https://web.archive.org/web/20190613130356/https://sourceforge.net/p/forge/documentation/markdown_syntax/. live.
- Web site: Markdown Editing Help. 2014-04-11. StackOverflow.com. 2014-03-28. https://web.archive.org/web/20140328061854/http://stackoverflow.com/editing-help. live.
- Web site: Markdown Syntax Documentation . daringfireball.net . 2021-03-01 . 2019-09-09 . https://web.archive.org/web/20190909051956/https://daringfireball.net/projects/markdown/syntax#html . live .
- Web site: Basic Syntax: Italic . Matt Cone . The Markdown Guide . 27 March 2022 . To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters. . 26 March 2022 . https://web.archive.org/web/20220326234942/https://www.markdownguide.org/basic-syntax/#italic . live .
- Web site: GitHub Flavored Markdown Examples . . GitHub . 2021-04-02 . 2021-05-13 . https://web.archive.org/web/20210513154115/https://github.com/mojombo/github-flavored-markdown/issues/1 . live .
- Web site: A formal spec for GitHub Flavored Markdown . GitHub Engineering . 14 March 2017 . 16 Mar 2017 . 3 February 2020 . https://web.archive.org/web/20200203205138/https://githubengineering.com/a-formal-spec-for-github-markdown/ . live .
- Web site: Fortin . Michel . PHP Markdown Extra . 2018 . Michel Fortin website . 2018-12-26 . 2021-01-17 . https://web.archive.org/web/20210117015819/https://michelf.ca/projects/php-markdown/extra/ . live .
- Web site: PHP Markdown Extra. Michel Fortin. 2018-12-26. 2021-01-17. https://web.archive.org/web/20210117015819/https://michelf.ca/projects/php-markdown/extra/. live.
- Web site: Markdown editor for BUEditor. 4 December 2008. 15 January 2017. 17 September 2020. https://web.archive.org/web/20200917172201/https://www.drupal.org/project/markdowneditor. live.
- Web site: Markdown for TYPO3 (markdown_content). extensions.typo3.org. 2019-02-06. 2021-02-01. https://web.archive.org/web/20210201205749/https://extensions.typo3.org/extension/markdown_content/. live.
- Web site: Dietrich. André. LiaScript. 2022-01-17. liascript.github.io. en. 2022-01-19. https://web.archive.org/web/20220119122544/https://liascript.github.io/. live.
- Web site: W3C Community Page of Markdown Implementations. W3C Markdown Wiki. 24 March 2016. 17 September 2020. https://web.archive.org/web/20200917231621/https://www.w3.org/community/markdown/wiki/MarkdownImplementations. live.
- Web site: 330707 - Add optional support for MarkDown . 2022-10-11 . bugzilla.mozilla.org . en . 2022-10-11 . https://web.archive.org/web/20221011143200/https://bugzilla.mozilla.org/show_bug.cgi?id=330707 . live .
- Web site: Markdown Text 101 (Chat Formatting: Bold, Italic, Underline). https://web.archive.org/web/20200626015843/https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-?page=4. dead. June 26, 2020. discord.com.
- Web site: Doxygen Manual: Markdown support. 2019-08-09. 2019-08-09. https://web.archive.org/web/20190809222422/http://doxygen.nl/manual/markdown.html. live.
- Web site: Writing on GitHub. help.github.com. GitHub, Inc.. 9 July 2014. 4 June 2018. https://web.archive.org/web/20180604165012/https://help.github.com/articles/writing-on-github/. live.
- EvolutionGnome . 1506712955743883283 . Evolution 3.44 is out and already available on #Flathub! Besides many smaller improvements and fixes it brings a markdown editor to compose messages. .
- Web site: Markdown Guide . 2022-07-14 . joplinapp.org . en . 2022-09-23 . https://web.archive.org/web/20220923082130/https://joplinapp.org/markdown/index.html . live .
- Web site: 2020-11-17. Why You Need a WYSIWYG Editor When Writing in Markdown and Fountain. 2020-12-06. JotterPad Blog. en. 2020-11-27. https://web.archive.org/web/20201127173121/https://blog.jotterpad.app/why-need-wysiwyg-markdown-fountain-editor/. live.
- Web site: Markdown Syntax — Kanboard documentation . 2022-10-11 . docs.kanboard.org . 2022-10-11 . https://web.archive.org/web/20221011143151/https://docs.kanboard.org/en/latest/user_guide/markdown_syntax.html . live .
- Web site: Markdown syntax for files, widgets, wikis - Azure DevOps . 25 March 2024 . 18 April 2024 . 18 April 2024 . https://web.archive.org/web/20240418165734/https://learn.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops . live .
- Web site: Use Markdown formatting in Teams. 2022-01-13. Microsoft. 2022-01-13. https://web.archive.org/web/20220113145710/https://support.microsoft.com/en-us/office/use-markdown-formatting-in-teams-4d10bd65-55e2-4b2d-a1f3-2bebdcd2c772. live.
- Web site: Akkoma - Magically Expressive Social Media . 2024-04-18 . akkoma.social . en . 2023-04-05 . https://web.archive.org/web/20230405054140/https://akkoma.social/ . live .
- Web site: MFM . 2024-04-18 . Misskey Hub . en-US . 2024-03-24 . https://web.archive.org/web/20240324181300/https://misskey-hub.net/en/docs/for-users/features/mfm/ . live .
- Web site: Nextcloud Notes * App. 2022-02-18. Nextcloud Apps. en. 2022-02-18. https://web.archive.org/web/20220218082520/https://apps.nextcloud.com/apps/notes. live.
- Web site: Obsidian . 2022-07-14 . obsidian.md . en . 2022-07-12 . https://web.archive.org/web/20220712202219/https://obsidian.md/ . live .
- Book: R Markdown: The Definitive Guide. 2021-08-23. 2021-04-13. https://web.archive.org/web/20210413073844/https://bookdown.org/yihui/rmarkdown/. live.
- Web site: Markdown.cpp. 2015-06-30. GitHub project RStudio. J.J.. Allaire. Joseph J. Allaire. e.a.. 2016-07-07. 2017-07-26. https://web.archive.org/web/20170726011514/https://github.com/rstudio/rstudio/blob/master/src/cpp/core/markdown/Markdown.cpp. live.
- Web site: 2015-07-30 . Help . 2022-07-14 . Simplenote . en . 2022-07-14 . https://web.archive.org/web/20220714190437/https://simplenote.com/help/ . live .