The story behind the Markdown editor

Markdown is a way to write formatted text that still reads naturally as plain text. Asterisks for emphasis, hash signs for headings and dashes for lists were borrowed from how people already wrote email. This page tells how that simple idea became the language of README files, notes and documentation.

An open notebook and a glowing split screen with plain text on one side and formatted text on the other on a dark desk
An open notebook and a glowing split screen with plain text on one side and formatted text on the other on a dark desk

Born from email

In 2004 John Gruber published Markdown on his site Daring Fireball, with help from Aaron Swartz. The goal was text that is easy to read and write as is, yet converts cleanly to HTML. Many conventions came from email and from older plain text formats such as Setext: underlining a line with equals signs to make a heading, starring a word to stress it and starting lines with a dash for a list. The first converter was a single Perl script.

Too many dialects

The original description left many corner cases open, such as how far a nested list must be indented or when a blank line ends a block. Every new implementation decided differently, so the same text could look different on different sites. In 2014 John MacFarlane, Jeff Atwood and others published a precise specification with hundreds of examples. It was first called Standard Markdown and, after objections from Gruber, renamed CommonMark.

GitHub Flavored Markdown

GitHub made Markdown part of daily work for programmers through README files, issues and comments. In 2017 it published a formal spec for GitHub Flavored Markdown as a strict superset of CommonMark. It adds tables with column alignment, task list items with checkboxes, strikethrough with two tildes and links that are recognised automatically. Fenced code blocks with a language name, already popular, enabled syntax highlighting.

Why previews are sanitized

Markdown allows raw HTML, which is convenient but risky. If a page shows Markdown from someone else, a hidden script tag, an onerror attribute on an image or a javascript link could run code in the reader's browser, an attack called cross site scripting. That is why this editor shows raw HTML as text, removes unsafe link schemes and filters the result through an allow list of elements and attributes before display.

Frequently asked questions

Who invented Markdown?

John Gruber created Markdown in 2004, with Aaron Swartz as an important early collaborator and tester.

What is the difference between CommonMark and GFM?

CommonMark is a precise specification of core Markdown. GitHub Flavored Markdown builds on it and adds tables, task lists, strikethrough and automatic links.

Why is my HTML shown as text?

For safety. Raw HTML could carry scripts, so the editor escapes it and only produces elements it knows are harmless.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Open the Markdown editor