spec.txt | spec.txt | |||
---|---|---|---|---|
--- | --- | |||
title: CommonMark Spec | title: CommonMark Spec | |||
author: | author: | |||
- John MacFarlane | - John MacFarlane | |||
version: 0.11 | version: 0.12 | |||
date: 2014-11-10 | date: 2014-11-10 | |||
... | ... | |||
# Introduction | # Introduction | |||
## What is Markdown? | ## What is Markdown? | |||
Markdown is a plain text format for writing structured documents, | Markdown is a plain text format for writing structured documents, | |||
based on conventions used for indicating formatting in email and | based on conventions used for indicating formatting in email and | |||
usenet posts. It was developed in 2004 by John Gruber, who wrote | usenet posts. It was developed in 2004 by John Gruber, who wrote | |||
skipping to change at line 5088 | skipping to change at line 5088 | |||
and title are given immediately after the link text. In [reference | and title are given immediately after the link text. In [reference | |||
links](#reference-links) the destination and title are defined elsewhere | links](#reference-links) the destination and title are defined elsewhere | |||
in the document. | in the document. | |||
A [link text](@link-text) consists of a sequence of zero or more | A [link text](@link-text) consists of a sequence of zero or more | |||
inline elements enclosed by square brackets (`[` and `]`). The | inline elements enclosed by square brackets (`[` and `]`). The | |||
following rules apply: | following rules apply: | |||
- Links may not contain other links, at any level of nesting. | - Links may not contain other links, at any level of nesting. | |||
- Brackets are allowed in the link text only if (a) they are | - Brackets are allowed in the [link text](#link-text) only if (a) they | |||
backslash-escaped or (b) they appear as a matched pair of brackets, | are backslash-escaped or (b) they appear as a matched pair of brackets, | |||
with an open bracket `[`, a sequence of zero or more inlines, and | with an open bracket `[`, a sequence of zero or more inlines, and | |||
a close bracket `]`. | a close bracket `]`. | |||
- Backtick [code spans](#code-span), [autolinks](#autolink), and | - Backtick [code spans](#code-span), [autolinks](#autolink), and | |||
raw [HTML tags](#html-tag) bind more tightly | raw [HTML tags](#html-tag) bind more tightly | |||
than the brackets in link text. Thus, for example, | than the brackets in link text. Thus, for example, | |||
`` [foo`]` `` could not be a link text, since the second `]` | `` [foo`]` `` could not be a link text, since the second `]` | |||
is part of a code span. | is part of a code span. | |||
- The brackets in link text bind more tightly than markers for | - The brackets in link text bind more tightly than markers for | |||
skipping to change at line 5851 | skipping to change at line 5851 | |||
<p>[foo]<a href="/url1">bar</a></p> | <p>[foo]<a href="/url1">bar</a></p> | |||
. | . | |||
## Images | ## Images | |||
Syntax for images is like the syntax for links, with one | Syntax for images is like the syntax for links, with one | |||
difference. Instead of [link text](#link-text), we have an [image | difference. Instead of [link text](#link-text), we have an [image | |||
description](@image-description). The rules for this are the | description](@image-description). The rules for this are the | |||
same as for [link text](#link-text), except that (a) an | same as for [link text](#link-text), except that (a) an | |||
image description starts with `![` rather than `[`, and | image description starts with `![` rather than `[`, and | |||
(b) an image description may contain links, but not images | (b) an image description may contain links. | |||
(even deeply nested). An image description has inline elements | An image description has inline elements | |||
as its contents. When an image is rendered to HTML, | as its contents. When an image is rendered to HTML, | |||
this is standardly used as the image's `alt` attribute. | this is standardly used as the image's `alt` attribute. | |||
. | . | |||
![foo](/url "title") | ![foo](/url "title") | |||
. | . | |||
<p><img src="/url" alt="foo" title="title" /></p> | <p><img src="/url" alt="foo" title="title" /></p> | |||
. | . | |||
. | . | |||
![foo *bar*] | ![foo *bar*] | |||
[foo *bar*]: train.jpg "train & tracks" | [foo *bar*]: train.jpg "train & tracks" | |||
. | . | |||
<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> | <p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> | |||
. | . | |||
. | . | |||
![foo ![bar](/url)](/url2) | ![foo ![bar](/url)](/url2) | |||
. | . | |||
<p>![foo <img src="/url" alt="bar" />](/url2)</p> | <p><img src="/url2" alt="foo bar" /></p> | |||
. | . | |||
. | . | |||
![foo [bar](/url)](/url2) | ![foo [bar](/url)](/url2) | |||
. | . | |||
<p><img src="/url2" alt="foo bar" /></p> | <p><img src="/url2" alt="foo bar" /></p> | |||
. | . | |||
Though this spec is concerned with parsing, not rendering, it is | Though this spec is concerned with parsing, not rendering, it is | |||
recommended that in rendering to HTML, only the plain string content | recommended that in rendering to HTML, only the plain string content | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |