| This is a guide to basic Markdown. Marked also handles MultiMarkdown, GitHub Flavored Markdown, CommonMark, and Kramdown, which add a few extra tricks. For more information on additional flavors, see the tabs in the menu bar above. |
| You can test out syntax for supported processorsin the Markdown Dingus. |
| Markdown | Result |
|---|---|
|
This text is emphasised . |
|
This text is bold . |
|
Here's a quote:
Excellent work, Kip! |
| Markdown | Result |
|---|---|
|
Link to Google . |
|
You should email me . |
|
My email address is jane@example.com . |
|
|
| Markdown | Result |
|---|---|
|
Large Heading |
|
Medium Heading |
|
Smaller Heading |
| Markdown | Result |
|---|---|
|
|
|
|
| Markdown | Result |
|---|---|
|
A sentence, followed by a rule.
Another sentence. |
|
Two *literal asterisks*, not to be confused with emphasis . |
You can choose between MultiMarkdown and Discount (GitHub Flavored Markdown) in the Processor pane of Marked preferences.
You can create superscript and subscript using ^ and ~ within blocks of text.
Text^super
Text~sub
Will produce:
Textsuper
Textsub
| First Header | Second Header |
| ------------- | ------------- |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |
Renders as:
| First Header | Second Header |
|---|---|
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |
In the second row of the table, use colons on either end of the row of dashes to indicate alignment for the column:
| Left-Aligned | Center Aligned | Right Aligned |
| :------------ |:---------------:| -----:|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
This code will cause the first column to be left-aligned, the second to be centered, and the third to be right-aligned.
Paragraph text with a footnote[^fn]
[^fn]: This is the footnote text.
Renders as:
You can also create footnotes inline using text[^footnote text] syntax. Note that this will not be
compatible with other processors or older versions of MultiMarkdown.
### Section header [myheaderid]
Renders as…
<h3 id="myheaderid">Section header</h3>
…and can be referenced with
[link text][myheaderid]
, which renders as a link that will jump to the referenced header.
Apple
: Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
: An american computer company.
Renders as:
Blocks of text beginning and ending with
```
will be formatted as pre/code blocks. Fenced code blocks must have a blank line before and after them.
You can optionally add a language specifier for syntax highlighting:
```ruby
.
Here's an example:
```
function test() {
console.log("notice the blank line before this function?");
}
```
Discount GFM (GitHub Flavored Markdown) is a C-based Markdown processor that implements GitHub’s extended Markdown syntax. It’s based on the original Discount library but enhanced with GitHub-specific features like tables, task lists, strikethrough text, and automatic URL linking.
Tables
:) in separator rows| Header 1 | Header 2 | Header 3 |
| :------- | :------: | -------: |
| Left | Center | Right |
| Aligned | Aligned | Aligned |
Task Lists
- [x] Completed task
- [ ] Pending task
- [x] Another completed task
Strikethrough Text
~~) becomes strikethrough<del> tags for semantic markup~~This text is crossed out~~
~~Mistaken text that should be removed~~
Fenced Code Blocks
```) for code blocks
function hello() {
console.log("Hello, World!");
}
**Automatic Language Detection**
- Support for many programming languages
- Proper syntax highlighting when supported
- Fallback to plain text for unsupported languages
### 3. **Automatic URL Linking**
**URL Autolinking**
- Automatic conversion of URLs to clickable links
- Support for http, https, and ftp protocols
- Email addresses automatically converted to mailto links
Visit http://example.com for more information.
Contact us at user@example.com
Smart Link Detection
Alphabetic Lists
<ol type="a"> outputa. First item
b. Second item
c. Third item
Enhanced List Processing
Reference-Style Footnotes
[^1] syntaxThis is a sentence with a footnote[^1].
[^1]: This is the footnote content.
Automatic Footnote Processing
HTML5 Support
Raw HTML Blocks
Relaxed Emphasis
_) don’t create emphasis in the middle of wordsThis is a variable_name that won't be emphasized.
This is _emphasized text_ that will be styled.
Multiple Emphasis Levels
<strong> and <em> tagsAutomatic TOC
Heading ID Generation
| Feature | Discount GFM | CommonMark | Kramdown | MultiMarkdown | Standard |
|---|---|---|---|---|---|
| Tables | Yes | No | Yes | Yes | No |
| Strikethrough | Yes | No | No | Yes | No |
| Task Lists | Yes | No | No | Yes | No |
| Fenced Code | Yes | Yes | Yes | Yes | No |
| Math | No | No | Yes | Yes | No |
| Footnotes | Yes | No | Yes | Yes | No |
| Definition Lists | No | No | Yes | Yes | No |
| Abbreviations | No | No | Yes | No | No |
| Attribute Lists | No | No | Yes | No | No |
| Extensions | Limited | No | Yes | Yes | No |
| Typography | Basic | No | Yes | No | No |
| Autolinks | Yes | No | No | No | No |
| Alphabetic Lists | Yes | No | No | No | No |
GitHub Documentation
Technical Writing
Content Management
Collaborative Editing
Output Features
Most standard Markdown works with Discount GFM without changes. To take advantage of GFM features:
~~text~~ for crossed-out contentThis documentation covers Discount GFM as implemented in Marked. For the most current information, always refer to the official GitHub Flavored Markdown specification.
CommonMark is a strongly specified, highly compatible implementation of Markdown. It was created to address the ambiguities and inconsistencies in John Gruber’s original Markdown specification, which led to divergent implementations across different platforms and tools.
The original Markdown specification by John Gruber was intentionally ambiguous in many areas, leading to different interpretations by various implementations. This created problems where the same Markdown document would render differently on different platforms (GitHub, StackOverflow, Reddit, etc.).
CommonMark provides:
CommonMark enforces more consistent parsing behavior:
Blank Lines Before Block Elements
Text
# Heading
CommonMark: Requires blank line before heading
Standard Markdown: Often allows without blank line
Indentation Requirements
1. First item
- Sublist item (4 spaces required in CommonMark)
2. Second item
List Continuation
<p> tags, tight lists don’tFenced Code Blocks
code here
**Indented Code Blocks**
- CommonMark requires blank lines before indented code blocks
- Standard Markdown often allows them without blank lines
### 4. **Link and Image Processing**
**Reference Link Precedence**
- CommonMark has clear rules for which reference definition takes precedence
- Multiple definitions for the same reference are handled consistently
[link1]: /url1
[link1]: /url2
[link1] <!-- Uses /url2 in CommonMark -->
Link Parsing Order
Nested Emphasis Rules
* and _ markers*foo *bar* baz* <!-- Clear precedence rules in CommonMark -->
Delimiter Processing
HTML Block Detection
<div>
This is an HTML block in CommonMark
</div>
Hard Line Breaks
Line one
Line two <!-- Two spaces before line break -->
Numeric Character References
— <!-- Decimal -->
— <!-- Hexadecimal -->
CommonMark uses a two-phase parsing approach:
| Feature | CommonMark | GitHub Flavored | MultiMarkdown | Standard |
|---|---|---|---|---|
| Tables | No | Yes | Yes | No |
| Strikethrough | No | Yes | Yes | No |
| Task Lists | No | Yes | Yes | No |
| Fenced Code | Yes | Yes | Yes | No |
| Math | No | Yes | Yes | No |
| Footnotes | No | No | Yes | No |
CommonMark is designed to be:
This documentation covers CommonMark 0.31.2 (2024–01–28). For the most current information, always refer to the official specification.
Kramdown is a fast, pure-Ruby Markdown-superset converter that extends the original Markdown syntax with features found in other implementations like Maruku, PHP Markdown Extra, and Pandoc. It provides a strict syntax with definite rules while maintaining compatibility with most Markdown documents.
Definition Lists
: to separate terms from definitionsTerm 1
: Definition 1
Term 2
: Definition 2a
: Definition 2b
Tables
kramdown supports a syntax for creating simple tables. A line starting with a pipe character (|)
starts
a table row. However, if the pipe characters is immediately followed by a dash (-), a separator line
is
created. Separator lines are used to split the table header from the table body (and optionally align the table
columns) and to split the table body into multiple parts. If the pipe character is followed by an equal sign
(=), the tables rows below it are part of the table footer.
| A simple | table |
| with multiple | lines|
With headers and footer
| Header1 | Header2 | Header3 |
|:--------|:-------:|--------:|
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
|----
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
|=====
| Foot1 | Foot2 | Foot3
{: rules="groups"}
Without alignment row
| Header1 | Header2 | Header3 |
| cell1 | cell2 | cell3 | | |
| cell4 | cell5 | cell6 |
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
| Foot1 | Foot2 | Foot3 |
Math Blocks
Inline math: $E = mc^2$
Block math:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
Footnotes
[^1] syntaxThis is a sentence with a footnote[^1].
[^1]: This is the footnote content.
Abbreviations
*[HTML]: HyperText Markup Language
*[CSS]: Cascading Style Sheets
This uses HTML and CSS.
Typographic Symbols
"Smart quotes" and -- em dashes -- and ... ellipses
Attribute List Definitions (ALDs)
{:ref-name: #myid .my-class title="My Title"}
A paragraph with attributes.
{: #para-one .highlight}
Inline Attribute Lists (IALs)
This *is*{:.underline} some `code`{:#id}{:.class}.
A [link](test.html){:rel='something'} and some **tools**{:.tools}.
Extensions
{::comment}
This text is completely ignored by kramdown.
{:/comment}
{::options key="val" /}
Language Specification
Automatic syntax highlighting for fenced code blocks
Support for many programming languages
def hello
puts "Hello, World!"
end
Standard Code Blocks
Line Wrapping
Tab Handling
Block Boundaries
Automatic Links
Reference Links
Image Attributes
{:width="300" height="200" class="responsive"}
HTML Blocks
HTML Spans
Inline Math
$...$ syntax for inline mathematical expressionsBlock Math
$$...$$ syntax for block mathematical expressions| Feature | Kramdown | CommonMark | GitHub Flavored | MultiMarkdown | Standard |
|---|---|---|---|---|---|
| Tables | Yes | No | Yes | Yes | No |
| Strikethrough | No | No | Yes | Yes | No |
| Task Lists | No | No | Yes | Yes | No |
| Fenced Code | Yes | Yes | Yes | Yes | No |
| Math | Yes | No | Yes | Yes | No |
| Footnotes | Yes | No | No | Yes | No |
| Definition Lists | Yes | No | No | Yes | No |
| Abbreviations | Yes | No | No | No | No |
| Attribute Lists | Yes | No | No | No | No |
| Extensions | Yes | No | No | No | No |
| Typography | Yes | No | No | No | No |
Jekyll Sites
Technical Documentation
Academic Writing
Content Management
Most standard Markdown documents work with Kramdown without modification. To take advantage of Kramdown’s features:
This documentation covers Kramdown 2.5.1. For the most current information, always refer to the official documentation at kramdown.gettalong.org.