├── 0.10 ├── index.html └── spec.txt ├── 0.11 ├── changes.html ├── index.html └── spec.txt ├── 0.12 ├── changes.html ├── index.html └── spec.txt ├── 0.13 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.14 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.15 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.16 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.17 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.18 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.19 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.20 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.21 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.22 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.23 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.24 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.25 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.26 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.27 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.28 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.29 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.30 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.31.2 ├── changes.html ├── index.html ├── spec.json └── spec.txt ├── 0.5 └── index.html ├── 0.6 ├── index.html └── spec.txt ├── 0.7 ├── index.html └── spec.txt ├── 0.8 └── index.html ├── 0.9 ├── index.html └── spec.txt ├── CNAME ├── Makefile ├── README.md ├── changelog.txt ├── current ├── index.html └── index.html.in ├── dingus.html ├── dingus ├── Makefile ├── bootstrap.min.css ├── bootstrap.min.js ├── bower.json ├── commonmark.js ├── dingus.css ├── dingus.js ├── index.html ├── jquery.min.js ├── jquery.min.map ├── lodash.min.js └── preview.html ├── index.html ├── js ├── LICENSE ├── commonmark.js └── index.html ├── make_site_index.sh ├── spec.html └── template.html /0.12/changes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Diff: spec.txt - spec.txt 13 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 |
 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 &amp; tracks" /></p> <p><img src="train.jpg" alt="foo bar" title="train &amp; 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/
137 | 138 | 139 | -------------------------------------------------------------------------------- /0.15/changes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Diff: spec.txt - spec.txt 13 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 |
 spec.txt   spec.txt 
--- ---
title: CommonMark Spec title: CommonMark Spec
author: author:
- John MacFarlane - John MacFarlane
version: 0.14 version: 0.15
date: 2014-12-10 date: 2014-12-31
license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)' license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
... ...
# 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 4440 skipping to change at line 4440
``` ```
The rules given below capture all of these patterns, while allowing The rules given below capture all of these patterns, while allowing
for efficient parsing strategies that do not backtrack. for efficient parsing strategies that do not backtrack.
First, some definitions. A [delimiter run](@delimiter-run) is either First, some definitions. A [delimiter run](@delimiter-run) is either
a sequence of one or more `*` characters that is not preceded or a sequence of one or more `*` characters that is not preceded or
followed by a `*` character, or a sequence of one or more `_` followed by a `*` character, or a sequence of one or more `_`
characters that is not preceded or followed by a `_` character. characters that is not preceded or followed by a `_` character.
A [left-flanking delimiter run](@right-facing-delimiter-run) is A [left-flanking delimiter run](@left-flanking-delimiter-run) is
a [delimiter run](#delimiter-run) that is (a) not followed by [unicode a [delimiter run](#delimiter-run) that is (a) not followed by [unicode
whitespace](#unicode-whitespace), and (b) either not followed by a whitespace](#unicode-whitespace), and (b) either not followed by a
[punctuation character](#punctuation-character), or [punctuation character](#punctuation-character), or
preceded by [unicode whitespace](#unicode-whitespace) or preceded by [unicode whitespace](#unicode-whitespace) or
a [punctuation character](#punctuation-character). a [punctuation character](#punctuation-character).
A [right-flanking delimiter run](@left-facing-delimiter-run) is A [right-flanking delimiter run](@right-flanking-delimiter-run) is
a [delimiter run](#delimiter-run) that is (a) not preceded by [unicode a [delimiter run](#delimiter-run) that is (a) not preceded by [unicode
whitespace](#unicode-whitespace), and (b) either not preceded by a whitespace](#unicode-whitespace), and (b) either not preceded by a
[punctuation character](#punctuation-character), or [punctuation character](#punctuation-character), or
followed by [unicode whitespace](#unicode-whitespace) or followed by [unicode whitespace](#unicode-whitespace) or
a [punctuation character](#punctuation-character). a [punctuation character](#punctuation-character).
Here are some examples of delimiter runs. Here are some examples of delimiter runs.
- left-flanking but not right-flanking: - left-flanking but not right-flanking:
skipping to change at line 4500 skipping to change at line 4500
after comes from Roopesh Chander's after comes from Roopesh Chander's
[vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-em 96 | phasis-tags). [vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-em 97 | phasis-tags).
vfmd uses the terminology "emphasis indicator string" instead of "delimiter vfmd uses the terminology "emphasis indicator string" instead of "delimiter
run," and its rules for distinguishing left- and right-flanking runs run," and its rules for distinguishing left- and right-flanking runs
are a bit more complex than the ones given here.) are a bit more complex than the ones given here.)
The following rules define emphasis and strong emphasis: The following rules define emphasis and strong emphasis:
1. A single `*` character [can open emphasis](@can-open-emphasis) 1. A single `*` character [can open emphasis](@can-open-emphasis)
iff it is part of a iff it is part of a
[left-flanking delimiter run](#right-facing-delimiter-run). [left-flanking delimiter run](#left-flanking-delimiter-run).
2. A single `_` character [can open emphasis](#can-open-emphasis) iff 2. A single `_` character [can open emphasis](#can-open-emphasis) iff
it is part of a it is part of a
[left-flanking delimiter run](#right-facing-delimiter-run) [left-flanking delimiter run](#left-flanking-delimiter-run)
and is not preceded by an ASCII alphanumeric character. and is not preceded by an ASCII alphanumeric character.
3. A single `*` character [can close emphasis](@can-close-emphasis) 3. A single `*` character [can close emphasis](@can-close-emphasis)
iff it is part of a iff it is part of a
[left-flanking delimiter run](#right-facing-delimiter-run). [right-flanking delimiter run](#right-flanking-delimiter-run).
4. A single `_` character [can close emphasis](#can-close-emphasis) 4. A single `_` character [can close emphasis](#can-close-emphasis)
iff it is part of a iff it is part of a
[left-flanking delimiter run](#right-facing-delimiter-run). [right-flanking delimiter run](#right-flanking-delimiter-run).
and it is not followed by an ASCII alphanumeric character. and it is not followed by an ASCII alphanumeric character.
5. A double `**` [can open strong emphasis](@can-open-strong-emphasis) 5. A double `**` [can open strong emphasis](@can-open-strong-emphasis)
iff it is part of a iff it is part of a
[left-flanking delimiter run](#right-facing-delimiter-run). [left-flanking delimiter run](#left-flanking-delimiter-run).
6. A double `__` [can open strong emphasis](#can-open-strong-emphasis) 6. A double `__` [can open strong emphasis](#can-open-strong-emphasis)
iff it is part of a iff it is part of a
[left-flanking delimiter run](#right-facing-delimiter-run) [left-flanking delimiter run](#left-flanking-delimiter-run)
and is not preceded by an ASCII alphanumeric character. and is not preceded by an ASCII alphanumeric character.
7. A double `**` [can close strong emphasis](@can-close-strong-emphasis) 7. A double `**` [can close strong emphasis](@can-close-strong-emphasis)
iff it is part of a iff it is part of a
[right-flanking delimiter run](#right-facing-delimiter-run). [right-flanking delimiter run](#right-flanking-delimiter-run).
8. A double `__` [can close strong emphasis](#can-close-strong-emphasis) 8. A double `__` [can close strong emphasis](#can-close-strong-emphasis)
iff it is part of a iff it is part of a
[right-flanking delimiter run](#right-facing-delimiter-run). [right-flanking delimiter run](#right-flanking-delimiter-run).
and is not followed by an ASCII alphanumeric character. and is not followed by an ASCII alphanumeric character.
9. Emphasis begins with a delimiter that [can open 9. Emphasis begins with a delimiter that [can open
emphasis](#can-open-emphasis) and ends with a delimiter that [can close emphasis](#can-open-emphasis) and ends with a delimiter that [can close
emphasis](#can-close-emphasis), and that uses the same emphasis](#can-close-emphasis), and that uses the same
character (`_` or `*`) as the opening delimiter. There must character (`_` or `*`) as the opening delimiter. There must
be a nonempty sequence of inlines between the open delimiter be a nonempty sequence of inlines between the open delimiter
and the closing delimiter; these form the contents of the emphasis and the closing delimiter; these form the contents of the emphasis
inline. inline.
skipping to change at line 4601 skipping to change at line 4601
Rule 1: Rule 1:
. .
*foo bar* *foo bar*
. .
<p><em>foo bar</em></p> <p><em>foo bar</em></p>
. .
This is not emphasis, because the opening `*` is followed by This is not emphasis, because the opening `*` is followed by
whitespace, and hence not part of a [left-flanking delimiter whitespace, and hence not part of a [left-flanking delimiter
run](#right-facing-delimiter-run): run](#left-flanking-delimiter-run):
. .
a * foo bar* a * foo bar*
. .
<p>a * foo bar*</p> <p>a * foo bar*</p>
. .
This is not emphasis, because the opening `*` is preceded This is not emphasis, because the opening `*` is preceded
by an alphanumeric and followed by punctuation, and hence by an alphanumeric and followed by punctuation, and hence
not part of a [left-flanking delimiter run](#right-facing-delimiter-run): not part of a [left-flanking delimiter run](#left-flanking-delimiter-run):
. .
a*"foo"* a*"foo"*
. .
<p>a*&quot;foo&quot;*</p> <p>a*&quot;foo&quot;*</p>
. .
Unicode nonbreaking spaces count as whitespace, too: Unicode nonbreaking spaces count as whitespace, too:
. .
skipping to change at line 4712 skipping to change at line 4712
. .
*foo bar * *foo bar *
. .
<p>*foo bar *</p> <p>*foo bar *</p>
. .
This is not emphasis, because the second `*` is This is not emphasis, because the second `*` is
preceded by punctuation and followed by an alphanumeric preceded by punctuation and followed by an alphanumeric
(hence it is not part of a [right-flanking delimiter (hence it is not part of a [right-flanking delimiter
run](#left-facing-delimiter-run): run](#right-flanking-delimiter-run):
. .
*(*foo) *(*foo)
. .
<p>*(*foo)</p> <p>*(*foo)</p>
. .
The point of this restriction is more easily appreciated The point of this restriction is more easily appreciated
with this example: with this example:
skipping to change at line 4804 skipping to change at line 4804
followed by whitespace: followed by whitespace:
. .
** foo bar** ** foo bar**
. .
<p>** foo bar**</p> <p>** foo bar**</p>
. .
This is not strong emphasis, because the opening `**` is preceded This is not strong emphasis, because the opening `**` is preceded
by an alphanumeric and followed by punctuation, and hence by an alphanumeric and followed by punctuation, and hence
not part of a [left-flanking delimiter run](#right-facing-delimiter-run): not part of a [left-flanking delimiter run](#left-flanking-delimiter-run):
. .
a**"foo"** a**"foo"**
. .
<p>a**&quot;foo&quot;**</p> <p>a**&quot;foo&quot;**</p>
. .
Intraword strong emphasis with `**` is permitted: Intraword strong emphasis with `**` is permitted:
. .
 End of changes. 15 change blocks. 
16 lines changed or deleted 16 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/
245 | 246 | 247 | -------------------------------------------------------------------------------- /0.25/changes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Diff: spec.txt - spec.txt 13 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 |
 spec.txt   spec.txt 
--- ---
title: CommonMark Spec title: CommonMark Spec
author: John MacFarlane author: John MacFarlane
version: 0.24 version: 0.25
date: '2016-01-12' date: '2016-03-24'
license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)' license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
... ...
# 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 302 skipping to change at line 302
. .
<ul> <ul>
<li> <li>
<p>foo</p> <p>foo</p>
<p>bar</p> <p>bar</p>
</li> </li>
</ul> </ul>
```````````````````````````````` ````````````````````````````````
```````````````````````````````` example ```````````````````````````````` example
>→foo→bar - foo
→→bar
.
<ul>
<li>
<p>foo</p>
<pre><code> bar
</code></pre>
</li>
</ul>
````````````````````````````````
```````````````````````````````` example
>→→foo
. .
<blockquote> <blockquote>
<p>foo→bar</p> <pre><code> foo
</code></pre>
</blockquote> </blockquote>
```````````````````````````````` ````````````````````````````````
```````````````````````````````` example ```````````````````````````````` example
-→→foo
.
<ul>
<li>
<pre><code> foo
</code></pre>
</li>
</ul>
````````````````````````````````
```````````````````````````````` example
foo foo
→bar →bar
. .
<pre><code>foo <pre><code>foo
bar bar
</code></pre> </code></pre>
```````````````````````````````` ````````````````````````````````
```````````````````````````````` example
- foo
- bar
→ - baz
.
<ul>
<li>foo
<ul>
<li>bar
<ul>
<li>baz</li>
</ul>
</li>
</ul>
</li>
</ul>
````````````````````````````````
## Insecure characters ## Insecure characters
For security reasons, the Unicode character `U+0000` must be replaced For security reasons, the Unicode character `U+0000` must be replaced
with the REPLACEMENT CHARACTER (`U+FFFD`). with the REPLACEMENT CHARACTER (`U+FFFD`).
# Blocks and inlines # Blocks and inlines
We can think of a document as a sequence of We can think of a document as a sequence of
[blocks](@)---structural elements like paragraphs, block [blocks](@)---structural elements like paragraphs, block
quotations, lists, headings, rules, and code blocks. Some blocks (like quotations, lists, headings, rules, and code blocks. Some blocks (like
skipping to change at line 1137 skipping to change at line 1181
baz baz
. .
<p>Foo <p>Foo
bar</p> bar</p>
<hr /> <hr />
<p>baz</p> <p>baz</p>
```````````````````````````````` ````````````````````````````````
or use a thematic break that cannot count as a [setext heading or use a thematic break that cannot count as a [setext heading
line], such as underline], such as
```````````````````````````````` example ```````````````````````````````` example
Foo Foo
bar bar
* * * * * *
baz baz
. .
<p>Foo <p>Foo
bar</p> bar</p>
<hr /> <hr />
skipping to change at line 8284 skipping to change at line 8328
If we encounter a new block start, we close any blocks unmatched If we encounter a new block start, we close any blocks unmatched
in step 1 before creating the new block as a child of the last in step 1 before creating the new block as a child of the last
matched block. matched block.
3. Finally, we look at the remainder of the line (after block 3. Finally, we look at the remainder of the line (after block
markers like `>`, list markers, and indentation have been consumed). markers like `>`, list markers, and indentation have been consumed).
This is text that can be incorporated into the last open This is text that can be incorporated into the last open
block (a paragraph, code block, heading, or raw HTML). block (a paragraph, code block, heading, or raw HTML).
Setext headings are formed when we see a line of a paragraph Setext headings are formed when we see a line of a paragraph
that is a setext heading line. that is a [setext heading underline].
Reference link definitions are detected when a paragraph is closed; Reference link definitions are detected when a paragraph is closed;
the accumulated text lines are parsed to see if they begin with the accumulated text lines are parsed to see if they begin with
one or more reference link definitions. Any remainder becomes a one or more reference link definitions. Any remainder becomes a
normal paragraph. normal paragraph.
We can see how this works by considering how the tree above is We can see how this works by considering how the tree above is
generated by four lines of Markdown: generated by four lines of Markdown:
``` markdown ``` markdown
 End of changes. 7 change blocks. 
6 lines changed or deleted 50 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/
199 | 200 | 201 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | spec.commonmark.org 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MAINREPO?=../commonmark-spec 2 | JSREPO?=../commonmark.js 3 | OLDSPECVERSION:=$(shell head -1 changelog.txt | sed -e 's/[^0-9.]//g') 4 | SPECVERSION=$(shell grep version: $(MAINREPO)/spec.txt | sed -e 's/version: *//' | sed -e "s/'//g") 5 | 6 | all: update 7 | echo "Spec version = $(SPECVERSION)" 8 | echo "Old spec version = $(OLDSPECVERSION)" 9 | git tag --list | grep -q -v $(SPECVERSION) ; \ 10 | mkdir -p $(SPECVERSION) ; \ 11 | make -C $(MAINREPO) spec.html ; \ 12 | cp $(MAINREPO)/spec.html $(SPECVERSION)/index.html; \ 13 | cp $(MAINREPO)/spec.txt $(SPECVERSION)/spec.txt; \ 14 | python3 $(MAINREPO)/test/spec_tests.py \ 15 | --spec $(SPECVERSION)/spec.txt \ 16 | --dump-tests > $(SPECVERSION)/spec.json; \ 17 | cp $(SPECVERSION)/index.html spec.html; \ 18 | ./make_site_index.sh $(OLDSPECVERSION) $(SPECVERSION) | \ 19 | pandoc --template template.html -s -t html5 -o index.html ; \ 20 | git add spec.html $(SPECVERSION)/index.html $(SPECVERSION)/changes.html $(SPECVERSION)/spec.txt $(SPECVERSION)/spec.json ; \ 21 | sed -e "s/VERSION/$(SPECVERSION)/g" current/index.html.in > current/index.html ; \ 22 | git commit -a -m "Updated to version $(SPECVERSION) of spec"; \ 23 | git tag $(SPECVERSION) HEAD 24 | 25 | update: 26 | make -C $(JSREPO)/dingus ; \ 27 | cp -r $(JSREPO)/dingus . ; \ 28 | cp $(JSREPO)/dist/commonmark.js js/commonmark.js; \ 29 | cp $(JSREPO)/LICENSE js/LICENSE; \ 30 | cp $(MAINREPO)/changelog.txt changelog.txt; \ 31 | 32 | upload: 33 | git pull; git push; git push --tags 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository contains the source for 2 | . 3 | 4 | It is mostly automatically generated from 5 | the spec itself and should not be manually 6 | modified. 7 | 8 | The repository for the other parts of 9 | can be found at 10 | . 11 | 12 | -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | [0.31.2] 2 | 3 | * Fix packaging bug (date not updated in spec.txt). 4 | 5 | [0.31.1] 6 | 7 | * Fix packaging bug (spec version not updated in spec.txt). 8 | 9 | [0.31] 10 | 11 | * Relicense npm package under CC-BY-SA (Yukai Chou). 12 | * Use archived vfmd link (Yukai Chou). 13 | * Link to babelmark2 legacy page. 14 | * Use https scheme in spec (including examples) (#751, Yukai Chou). 15 | * Fix unicode symbols example in emphasis syntax (rhysd). 16 | * Remove confusing "first" before "link label." 17 | * Add symbols to unicode punctuation (Titus Wormer). 18 | * Update link to AsciiDoc (Jarno Elovirta). 19 | * Add `search` element to list of known block elements (Titus Wormer). 20 | * Terminology: compact -> collapsed reference link. 21 | * Correct emphasis typo (Mike Pennisi). 22 | * Remove restrictive limitation on inline comments; now we match 23 | the HTML spec (Titus Wormer). 24 | * Fix spelling of "down side" to "downside" (Erik Duveblad). 25 | * Fix typo (missing words) (Denis Howe). 26 | * Remove `source` element as HTML block start condition (Lukas Spieß). 27 | * Fix typo (Nicolas Hedger). 28 | * `spec_tests.py` improvements (Martin Fischer): introduce `--track` option, 29 | simplify code, show diffs of normalized HTML, fix UnicodeDecodeError catching. 30 | * Use archived gmane links. 31 | * Fix typo (#693, Salim B). 32 | * Remove unnecessary lines from commonmark/commonmark-spec#95. 33 | * Fix typo (#683, nadashin). 34 | 35 | [0.30] 36 | 37 | * Add note clarifying that not every feature of HTML examples is normative 38 | (#672). 39 | * Move "Backslash escapes" and "Character references" to "Preliminaries" 40 | (#600). It was confusing having them in the "Inline" section, since 41 | they also affect some block contexts (e.g. reference link definitions). 42 | * Clarify wording in spec for character groups (#618, Titus Wormer, with 43 | Johel Ernesto Guerror Peña). 44 | + Remove line tabulation, form feed from whitespace 45 | + Rename newline to line feed or line ending 46 | + Reword spec to be more explicit about whitespace 47 | + Rename `Punctuation` to `Unicode punctuation` 48 | + Reword description of line breaks 49 | + Link unicode punctuation 50 | + Clarify link whitespace by describing "link information" 51 | + Clarify link destination and title 52 | * Add definition of ASCII control characters (#603, Titus Wormer). 53 | * Fix wording in start condition of type 7 HTML (#665, Titus Wormer). 54 | * Add `textarea` to list of literal HTML block tags (#657). 55 | Like `script`, `style`, and `pre`, `textarea` blocks can contain 56 | blank lines without the contents being interpret as commonmark. 57 | * Add `textarea` to more cases (#667, Titus Wormer). 58 | * Remove superfluous restrictions on declarations (#620, Titus Wormer). 59 | HTML declarations need not be limited to all capital ASCII letters. 60 | * Add inline link examples with empty link text (#636, jsteuer). 61 | * Remove outdated restriction on list item (#627, Johel Ernesto Guerrero 62 | Peña). This is a holdover from the days when two blank lines 63 | broke out of a list. 64 | * Add example with unbalanced parens in link destination. 65 | * Clarify that new blocks are added to *container* blocks. (#598, Jay 66 | Weisskopf). 67 | * Clarify language for backtick code spans (#589, Johel Ernesto Guerrero 68 | Peña). 69 | * Fix link text grouping sample (#584, Ashe Connor, Johel Ernesto 70 | Guerrero Peña). 71 | * Fix misleading text for full reference link (#581). There is no 72 | "first link label" here, just a link text. 73 | * Use better example to test unicode case fold for reference links (#582). 74 | The earlier test could be passed by implementations that just uppercase. 75 | * Test new entity length constraints (#575, Miha Zupan). 76 | * normalize.py: replace cgi.escape with html.escape (#656, 77 | Christopher Fujino). 78 | * tools/make_spec.lua: 79 | + Fix unqualified calls to node_append_child. 80 | + Remove extraneous href attribute on headings (#625, Christoph Päper). 81 | + Properly handle cross-refs (#578). Previously it broke in a few cases, 82 | e.g. with soft breaks. 83 | + Use unsafe mode so HTML isn't filtered out. 84 | + Changes for compatibility with lua 5.3's new number type. 85 | * CSS and HTML improvements in HTML version of spec 86 | (#639, #641, 642, Andrei Korzhyts). 87 | * Revise emphasis parsing algorithm description in light of 88 | commonmark/cmark#383. 89 | * Add documentation of the npm package to README.md (thanks to 90 | Shawn Erquhart). 91 | * Fix anchor definition for 'end condition'. 92 | * Remove duplicate example (#660, Titus Wormer). 93 | * Remove duplicate links in spec (#655, Levi Gruspe). 94 | * Various typo fixes (#632, Scott Abbey; #623, Anthony Fok; #601, #617, #659, 95 | Titus Wormer). 96 | 97 | [0.29] 98 | 99 | * Clarify that entities can't be used to indicate structure (#474). 100 | For example, you can't use `*` instead of `*` for a bullet 101 | list, or ` ` to create a new paragraph. 102 | * Limit numerical entities to 6 hex or 7 decimal digits (#487). 103 | This is all that is needed given the upper bound on 104 | unicode code points. 105 | * Specify dropping of initial/final whitespace in setext heading content 106 | (#461). 107 | * Add example with a reference link definition where the reference is never 108 | used (#454). 109 | * Add example with setext header after reference link defs (#395). 110 | * Clarify that script, pre, style close tags can begin an HTML block (#517). 111 | * Remove `meta` from list of block tags in start condition #6 of 112 | HTML blocks (#527). meta tags are used in some inline contexts (though 113 | this isn't valid HTML5), e.g. in schema.org. 114 | * Disallow newlines inside of unquoted attributes (#507, 115 | Shyouhei Urabe) as per HTML spec: 116 | . 117 | * Remove vestigial restriction in list item spec (#543). 118 | The "not separated by more than one blank line" was a left-over 119 | from an earlier version of the spec in which two blank lines 120 | ended a list. 121 | * Fix tests where list items are indented 4+ spaces (#497). 122 | The tests did not accord with the spec here; these 123 | lines should be continuation lines (if no blank space) 124 | or indented code blocks (if blank space). 125 | * Clarify tildes and backticks in info strings (#119). 126 | We disallow backticks in info strings after backtick fences 127 | only. Both backticks and tildes are allowed in info strings 128 | after tilde fences. Add example. 129 | * Indicate that info string is trimmed of all whitespace (#505, Ashe 130 | Connor). As noted in 131 | , the info string 132 | is not only trimmed of "spaces" (U+0020) but also of tabs. 133 | * Don't strip spaces in code span containing only spaces (#569). 134 | This allows one to include a code span with just spaces, 135 | using the most obvious syntax. 136 | * Add example w/ reference link w/ empty destination in `<>` (#172). 137 | * Disallow link destination beginning with `<` unless it is inside `<..>` 138 | (#538). This brings the description in line with the spec example: 139 | ``` 140 | [foo]: (baz) 141 | 142 | [foo] 143 | . 144 |

[foo]: (baz)

145 |

[foo]

146 | ``` 147 | * Allow spaces inside link destinations in pointy brackets (#503). 148 | This reverts a change in 0.24 and should make things easier 149 | for people working with image paths containing spaces. 150 | * Remove redundant condition. We don't need to specify that the absolute 151 | URI in an autolink doesn't contain `<`, since this is specified in 152 | the description of an absolute URI. 153 | * Add additional spec examples involving link destinations in `<>` (#473). 154 | * Add test for `[test]()` (#562). 155 | * Disallow unescaped `(` in parenthesized link titles (#526). 156 | * Add example showing need for space before title in reference link (#469). 157 | * Add codepoints for punctuation characters (#564, Christoph Päper). 158 | * Clarify the left- and right-flanking definitions (#534, Jay Martin). 159 | * Match interior delimiter runs if lengths of both are multiples of 3 160 | (#528). This gives better results on `a***b***c` without giving bad 161 | results on the cases that motivated the original multiple of 3 rule. 162 | * Add another test case for emphasis (#509, Michael Howell). 163 | * Code spans: don't collapse interior space (#532). 164 | * Simplify revisions to code span normalization rules. 165 | Remove the complex rule about ignoring newlines adjacent 166 | to spaces. Now newlines are simply converted to spaces. 167 | * Replace image 'url' with 'destination' (#512, Phill). 168 | * Add some links for occurrences of "above" (#480). 169 | * Various typo fixes (#514, Kenta Sato; #533, nikolas; 170 | tnaia, #556; #551, Grahame Grieve). 171 | * Create .gitattributes so that changelog.txt is highlighted as 172 | markdown (#499, Christoph Päper). 173 | * Update GitHub links (Morten Piibeleht). 174 | * Update references to container and leaf block headers to use the 175 | correct pluralization (#531, Elijah Hamovitz). 176 | * Rephrase example #111 to indicate that the rendering is not mandated 177 | (#568). 178 | * Improve documentation of parsing strategy (#563). 179 | Note that `openers_bottom` needs to be indexed to 180 | delimiter run lengths as well as types. 181 | * make_spec.lua: Fix migration of children nodes in create_anchors (#536, 182 | Zhiming Wang). This resulted in some bugs in the rendered spec 183 | (where words would be dropped from links). 184 | * Fix dingus link when double clicking Markdown code (#535, Zhiming Wang). 185 | Prior to this commit, the link opened is always `/dingus/?text=` (no 186 | text). 187 | * Add spec.json generator to Makefile (M Pacer). 188 | 189 | [0.28] 190 | 191 | * Allow unlimited balanced pairs of parentheses in link URLs 192 | (@kivikakk, commonmark/cmark#166). The rationale is that there are many URLs 193 | containing unescaped nested parentheses. Note that 194 | implementations are allowed to impose limits on parentheses 195 | nesting for performance reasons, but at least three levels 196 | of nesting should be supported. 197 | * Change Rule 14 for Emphasis. Previously the nesting 198 | Strong (Emph (...)) was preferred over Emph (Strong (...)). 199 | This change makes Emph (Strong (...)) preferred. 200 | Note that the commonmark reference implementations 201 | were not entirely consistent about this rule, giving 202 | different results for 203 | 204 | ***hi*** 205 | 206 | and 207 | 208 | ***hi**** 209 | 210 | This change simplifies parsing. It goes against the majority 211 | of implementations, but only on something utterly trivial. 212 | * Clarify definition of delimiter runs (Aidan Woods, #485). 213 | * Clarify precedence of thematic breaks over list items 214 | in the list spec, not just the thematic break spec (Aidan Woods). 215 | * Clarify definition of link labels and normalization 216 | procedure (Matthias Geier, #479). 217 | * Clarify that the end of an HTML block is determined by its 218 | start, and is not changed by HTML tags encountered inside 219 | the block. Give an example of a case where a block ends 220 | before an interior element has been closed (Yuki Izumi, #459). 221 | In the future we might consider changing the spec to handle 222 | this case more intuitively; this change just documents more 223 | explicitly what the spec requires. 224 | * Acknowledge Aaron Swartz's role in developing Markdown. 225 | * Remove misleading backslash in example for disabling image markup 226 | (Matthias Geier). 227 | * Fix Unicode terminology (general category, not class) 228 | (Philipp Matthias Schaefer). 229 | * Add another illustrative case for code spans (#463). 230 | * Remove possibly misleading 'either's (#467). 231 | * Fix typo (Aidan Woods). 232 | * Clarify that some blocks can contain code spans (Matthias Geier). 233 | * Fix typo and clarified tab expansion rule (Scott Abbey). 234 | * Add a missing "iff" (Matthias Geier). 235 | * Add release checklist. 236 | * Added npm package for spec (Vitaly Puzrin). 237 | * Remove SPEC variable from Makefile. 238 | 239 | [0.27] 240 | 241 | * Update statement on blank lines and lists (Jesse Rosenthal). 242 | The definition of a list still said that "two blank lines end all 243 | containing lists." That rule has been removed. 244 | * Clarify that the exception for ordered lists only applies to first 245 | item in list (#420). 246 | * Added cases clarifying precedence of shortcut links (#427). 247 | * Added h2..h6 to block tag list (#430). 248 | * Remove duplicated test (Maxim Dikun). Tests 390 and 391 were the same. 249 | * Use fenced code blocks for markdown examples that are not test cases 250 | for uniformity. 251 | * Added closing paren (#428). 252 | * Test suite: Don't mess up on examples with 32 backticks (#423). 253 | * Removed duplicate reference to "container block". 254 | * Add examples for Unicode whitespace (Timothy Gu). In light of 255 | commonmark/commonmark.js#107, add a few examples/test cases to make sure the 256 | distinction between Unicode whitespace and regular whitespace is kept. 257 | * Fix missing closing paren typo (Robin Stocker). 258 | 259 | [0.26] 260 | 261 | * Empty list items can no longer interrupt a paragraph. 262 | This removes an ambiguity between setext headers and 263 | lists in cases like 264 | 265 | foo 266 | - 267 | 268 | Removed the "two blank lines breaks out of lists" rule. 269 | This is incompatible with the principle of uniformity 270 | (and indeed with the spec for list items, which requires 271 | that the meaning of a chunk of lines not change when it 272 | is put into a list item.) 273 | * Ordered list markers that interrupt a paragraph must start with 1. 274 | * Improved the section on tabs. Added some test cases for ATX 275 | headers and thematic breaks. Clarified that it's not just cases 276 | that affect indentation that matter, but all cases where whitespace 277 | matters for block structure. 278 | * Removed example of ATX header with tab after `#`. 279 | * Allow HTML blocks to end on the last line of their container 280 | (Colin O'Dell, #103). 281 | * Spec changes in strong/emph parsing. See 282 | https://talk.commonmark.org/t/emphasis-strong-emphasis-corner-cases/2123 283 | for motivation. This restores intuitive parsings for a number of cases. 284 | The main change is to disallow strong or emph when one of 285 | the delimiters is "internal" and the sum of the lengths of 286 | the enclosing delimiter runs is a multiple of 3. Thus, 287 | `**foo*bar***` gets parsed `foo*bar` rather than 288 | `foobar**` as before. Thanks to Fletcher Penney 289 | for discussion. 290 | * Add tests to check that markdown parsing is working fine after an HTML 291 | block end tag (Alexandre Mutel). 292 | * Add test case for nested lists with an indent > 4 (Alexandre Mutel). 293 | * Cleaned up terminology around lazy continuation lines. Added some links. 294 | * Fixed broken links and typos (Artyom, Matthias Geier, Sam Estep). 295 | * Use `≤` instead of `<` in list item spec for clarity. 296 | * Add point about readibility to "What is Markdown" section. 297 | * Add example for list item starting with a blank line with spaces 298 | (Robin Stocker). 299 | * Make interact more button-like and clearer (Jeff Atwood). 300 | * `spec_tests.py`: exit code is now sum of failures and errors. 301 | * `spec_tests.py`: specify newline when opening file. 302 | 303 | [0.25] 304 | 305 | * Added several more tab-handling cases (see commonmark/cmark#101). 306 | * Fixed spec test for tabs. In the blockquote with a tab following 307 | the `>`, only one space should be consumed, yielding two spaces 308 | at the beginning of the content. 309 | * Update license year range to 2016 (Prayag Verma). 310 | * Fixed typo: setext heading line -> setext heading underline (#389). 311 | * Fixed date 2015->2016 (#388) 312 | 313 | [0.24] 314 | 315 | * New format for spec tests, new lua formatter for specs. 316 | The format for the spec examples has changed from 317 | 318 | . 319 | markdown 320 | . 321 | html 322 | . 323 | 324 | to 325 | 326 | ```````````````````````````````` example 327 | markdown 328 | . 329 | html 330 | ```````````````````````````````` 331 | 332 | One advantage of this is that `spec.txt` becomes a valid 333 | CommonMark file. 334 | * Change `tests/spec_test.py` to use the new format. 335 | * Replace `tools/makespec.py` with a lua script, `tools/make_spec.lua`, 336 | which uses the `lcmark` rock (and indirectly libcmark). It can 337 | generate HTML, LaTeX, and CommonMark versions of the spec. Pandoc 338 | is no longer needed for the latex/PDF version. And, since the new 339 | program uses the cmark API and operates directly on the parse tree, 340 | we get much more reliable translations than we got with the old 341 | Python script (#387). 342 | * Remove whitelist of valid schemes. Now a scheme is any sequence 343 | of 2-32 characters, beginning with an ASCII letter, and containing 344 | only ASCII letters, digits, and the symbols `-`, `+`, `.`. 345 | Discussion at . 346 | * Added an example: URI schemes must be more than one character. 347 | * Disallow spaces in link destinations, even inside pointy braces. 348 | Discussion at and 349 | . 350 | * Modify setext heading spec to allow multiline headings. 351 | Text like 352 | 353 | Foo 354 | bar 355 | --- 356 | baz 357 | 358 | is now interpreted as heading + paragraph, rather than 359 | paragraph + thematic break + paragraph. 360 | * Call U+FFFD the REPLACEMENT CHARACTER, not the "unknown code 361 | point character." 362 | * Change misleading undefined entity name example. 363 | * Remove misleading claim about entity references in raw HTML 364 | (a regression in 0.23). Entity references are not treated 365 | as literal text in raw HTML; they are just passed through. 366 | * CommonMark.dtd: allow `item` in `custom_block`. 367 | 368 | [0.23] 369 | 370 | * Don't allow space between link text and link label in a 371 | reference link. This fixes the problem of inadvertent capture: 372 | 373 | [foo] [bar] 374 | 375 | [foo]: /u1 376 | [bar]: /u2 377 | * Rename "horizontal rule" -> "thematic break". This matches the HTML5 378 | meaning for the hr element, and recognizes that the element may be 379 | rendered in various ways (not always as a horizontal rule). 380 | See http://talk.commonmark.org/t/horizontal-rule-or-thematic-break/912/3 381 | * Rename "header" -> "heading". This avoids a confusion that might arise 382 | now that HTML5 has a "header" element, distinct from the "headings" 383 | h1, h2, ... Our headings correspond to HTML5 headings, not HTML5 headers. 384 | The terminology of 'headings' is more natural, too. 385 | * ATX headers: clarify that a space (or EOL) is needed; other whitespace 386 | won't do (#373). Added a test case. 387 | * Rewrote "Entities" section with more correct terminology (#375). 388 | Entity references and numeric character references. 389 | * Clarified that spec does not dictate URL encoding/normalization policy. 390 | * New test case: list item code block with empty line (Craig M. 391 | Brandenburg). 392 | * Added example with escaped backslash at end of link label (#325). 393 | * Shortened an example so it doesn't wrap (#371). 394 | * Fixed duplicate id "attribute". 395 | * Fix four link targets (Lucas Werkmeister). 396 | * Fix typo for link to "attributes" (Robin Stocker). 397 | * Fix "delimiter" spellings and links (Sam Rawlins). 398 | * Consistent usage of "we" instead of "I" (renzo). 399 | * CommonMark.dtd - Rename `html` -> `html_block`, 400 | `inline_html` -> `html_inline` for consistency. (Otherwise it is too 401 | hard to remember whether `html` is block or inline, a source of 402 | some bugs.) 403 | * CommonMark.dtd - added `xmlns` attribute to document. 404 | * CommonMark.dtd - added `custom_block`, `custom_inline`. 405 | * CommonMark.dtd - renamed `hrule` to `thematic_break`. 406 | * Fixed some HTML inline tests, which were actually HTML blocks, given 407 | the changes to block parsing rules since these examples were written 408 | (#382). 409 | * Normalize URLs when comparing test output. This way we don't fail 410 | tests for legitimate variations in URL escaping/normalization policies 411 | (#334). 412 | * `normalize.py`: don't use `HTMLParseError`, which has been removed 413 | as of python 3.5 (#380). 414 | * Minor spacing adjustments in test output, to match cmark's output, 415 | since we test cmark without normalization. 416 | * `makespec.py`: remove need for link anchors to be on one line. 417 | * `makespec.py`: Only do two levels in the TOC. 418 | * Use `display:inline-block` rather than floats for side-by-side. 419 | This works when printed too. 420 | * Added better print CSS. 421 | 422 | [0.22] 423 | 424 | * Don't list `title` twice as HTML block tag (Robin Stocker). 425 | * More direct example of type 7 HTML block starting with closing tag. 426 | * Clarified rule 7 for HTML blocks. `pre`, `script`, and `style` 427 | are excluded because they're covered by other rules. 428 | * Clarified that type 7 HTML blocks can start with a closing tag (#349). 429 | * Removed `pre` tag from rule 6 of HTML blocks (#355). 430 | It is already covered by rule 1, so this removes an ambiguity. 431 | * Added `iframe` to list of tags that always start HTML blocks (#352). 432 | * Added example of list item starting with two blanks (#332). 433 | * Added test case clarifying laziness in block quotes (see 434 | commonmark/commonmark.js#60). 435 | * Add an example with mixed indentation code block in "Tabs" section 436 | (Robin Stocker). This makes sure that implementations skip columns instead 437 | of offsets for continued indented code blocks. 438 | * Clarified that in ATX headers, the closing `#`s must be unescaped, 439 | and removed misleading reference to "non-whitespace character" in 440 | an example (#356). 441 | * Changed anchor for "non-whitespace character" to reflect new name. 442 | * Removed ambiguities concerning lines and line endings (#357, Lasse 443 | R.H. Nielsen). The previous spec allowed, technically, that a line 444 | ending in `\r\n` might be considered to have two line endings, 445 | or that the `\r` might be considered part of the line and the 446 | `\n` the line ending. These fixes rule out those interpretations. 447 | * Clarify that a character is any code point. 448 | * Space in "code point". 449 | * Capitalize "Unicode". 450 | * Reflow paragraph to avoid unwanted list item (#360, #361). 451 | * Avoid extra space before section number in `spec.md`. 452 | * `makespec.py`: Use `check_output` for simpler `pipe_through_prog`. 453 | * In README, clarified build requirements for `spec.html`, `spec.pdf`. 454 | * Fixed some encoding issues in `makespec.py` (#353). 455 | * Fixed various problems with `spec.pdf` generation (#353). 456 | * Added version to coverpage in PDF version of spec. 457 | 458 | [0.21.1] 459 | 460 | * Added date. 461 | 462 | [0.21] 463 | 464 | * Changed handling of tabs. Instead of having a preprocessing step 465 | where tabs are converted to spaces, we now handle tabs directly in 466 | the parser. This allows tabs to be retained in code blocks and code 467 | spans. This change adds some general language to the effect that, 468 | for purposes of determining block structure, tabs are to be treated 469 | just like equivalent spaces. 470 | * Completely rewrote spec for HTML blocks. The new spec provides 471 | better handling of tags like ``, which can be either block 472 | or inline level content, better handling of custom tags, and 473 | better handling of verbatim contexts like `
`, comments,
474 |     and `
9 | 


--------------------------------------------------------------------------------
/current/index.html.in:
--------------------------------------------------------------------------------
1 | 
2 | 
3 | Redirecting...
4 | 
5 | 
6 | 

Redirecting...

7 | Click here if you are not redirected. 8 | 9 | -------------------------------------------------------------------------------- /dingus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CommonMark dingus 5 | 7 | 8 | 9 |

The most recent version of the CommonMark dingus can be found 10 | at http://spec.commonmark.org/dingus/.

12 | 13 | 14 | -------------------------------------------------------------------------------- /dingus/Makefile: -------------------------------------------------------------------------------- 1 | ALL=commonmark.js 2 | COMPONENTS=lodash.min.js jquery.min.js jquery.min.map bootstrap.min.js bootstrap.min.css 3 | LIBFILES=../lib/blocks.js ../lib/common.js ../lib/from-code-point.js ../lib/inlines.js ../lib/index.js ../lib/node.js ../lib/render/xml.js ../lib/render/html.js ../lib/render/renderer.js 4 | BOWER=../node_modules/.bin/bower 5 | HTTPSERVER=../node_modules/.bin/http-server 6 | 7 | all: $(ALL) components $(COMPONENTS) 8 | 9 | .PHONY: all dingus components clean 10 | 11 | components: 12 | $(BOWER) install 13 | 14 | lodash.min.js: bower_components/lodash 15 | cp $this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(idocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-dc.width?"left":"left"==s&&l.left-ha.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;ha.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e=n[t]&&(n[t+1]===undefined||e .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n 0) { 52 | if (elt.offset()) { 53 | preview.animate( 54 | { 55 | scrollTop: elt.offset().top - 100 56 | }, 57 | 50 58 | ); 59 | } 60 | } 61 | }; 62 | 63 | var markSelection = function() { 64 | var cursorPos = $("#text").prop("selectionStart"); 65 | // now count newline up to this pos 66 | var textval = $("#text").val(); 67 | var lineNumber = 1; 68 | for (var i = 0; i < cursorPos; i++) { 69 | if (textval.charAt(i) === "\n") { 70 | lineNumber++; 71 | } 72 | } 73 | var preview = $("#preview iframe") 74 | .contents() 75 | .find("body"); 76 | var elt = preview.find("[data-sourcepos^='" + lineNumber + ":']").last(); 77 | if (elt.length > 0) { 78 | preview.find(".selected").removeClass("selected"); 79 | elt.addClass("selected"); 80 | } 81 | syncScroll(); 82 | }; 83 | 84 | var parseAndRender = function() { 85 | var textarea = $("#text"); 86 | var startTime = new Date().getTime(); 87 | var parsed = reader.parse(textarea.val()); 88 | var endTime = new Date().getTime(); 89 | var parseTime = endTime - startTime; 90 | $("#parsetime").text(parseTime); 91 | $(".timing").css("visibility", "visible"); 92 | render(parsed); 93 | markSelection(); 94 | }; 95 | 96 | var onIframeLoad = function() { 97 | var textarea = $("#text"); 98 | var initial_text = getQueryVariable("text"); 99 | var smartSelected = getQueryVariable("smart") === "1"; 100 | $("#smart").prop("checked", smartSelected); 101 | reader.options.smart = smartSelected; 102 | if (initial_text) { 103 | textarea.val(initial_text); 104 | } 105 | 106 | parseAndRender(); 107 | 108 | $("#clear-text-box").click(function() { 109 | textarea.val(""); 110 | parseAndRender(); 111 | }); 112 | 113 | $("#permalink").click(function() { 114 | var smart = $("#smart").prop("checked"); 115 | window.location.pathname = "/index.html"; 116 | window.location.search = 117 | "text=" + 118 | encodeURIComponent(textarea.val()) + 119 | (smart ? "&smart=1" : ""); 120 | }); 121 | 122 | textarea.bind( 123 | "input propertychange", 124 | _.debounce(parseAndRender, 50, { maxWait: 100 }) 125 | ); 126 | //textarea.on('scroll', _.debounce(syncScroll, 50, { maxWait: 50 })); 127 | textarea.on("scroll", syncScroll); 128 | textarea.on( 129 | "keydown click focus", 130 | _.debounce(markSelection, 50, { maxWait: 100 }) 131 | ); 132 | 133 | $("#smart").click(function() { 134 | reader.options.smart = $("#smart").prop("checked"); 135 | parseAndRender(); 136 | }); 137 | }; 138 | 139 | var iframeLoaded = false; 140 | 141 | $("iframe").on("load", function() { 142 | iframeLoaded = true; 143 | }); 144 | 145 | $(document).ready(function() { 146 | if (iframeLoaded) { 147 | onIframeLoad(); 148 | } else { 149 | $("iframe").on("load", onIframeLoad); 150 | } 151 | }); 152 | -------------------------------------------------------------------------------- /dingus/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commonmark.js demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

commonmark.js dingus

18 |
19 |
20 |
21 |
22 |

clear     24 | 25 | 26 |

27 | 39 |
    40 |
    41 |
    42 | 47 |
    48 |
    49 | 50 |
    51 |
    52 |
    53 |
    54 |
    55 |
    56 |
    57 |
    58 |
    Parsed in 59 | ms. Rendered in ms.
    60 |
    61 |
    62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /dingus/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commonmark.js preview 6 | 7 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CommonMark Spec 6 | 72 | 73 | 74 | 75 |

    CommonMark Spec

    76 |
    77 | 78 |
    79 |
    80 | Creative
 82 |    Commons BY-SA
    CommonMark Spec by 87 | John MacFarlane is licensed under a 90 | Creative 92 | Commons Attribution-ShareAlike 4.0 International License. 93 |
    94 |
    95 | 96 |
    97 |
    98 |

    Latest version (0.31.2) 99 | (2024-01-28)

    100 |

    discussion forum | interactive dingus | repository | 103 | changelog

    104 |

    All versions:

    105 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, John MacFarlane 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | --- 29 | 30 | lib/from-code-point.js is derived from a polyfill 31 | Copyright Mathias Bynens 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining 34 | a copy of this software and associated documentation files (the 35 | "Software"), to deal in the Software without restriction, including 36 | without limitation the rights to use, copy, modify, merge, publish, 37 | distribute, sublicense, and/or sell copies of the Software, and to 38 | permit persons to whom the Software is furnished to do so, subject to 39 | the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be 42 | included in all copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 45 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 46 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 47 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 48 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 49 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 50 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 51 | 52 | --- 53 | 54 | bench/samples/*.md: 55 | 56 | With the exception of `bench/samples/README.md`, the samples in 57 | `bench/samples` are taken from https://github.com/markdown-it/markdown-it. 58 | 59 | Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin. 60 | 61 | Permission is hereby granted, free of charge, to any person 62 | obtaining a copy of this software and associated documentation 63 | files (the "Software"), to deal in the Software without 64 | restriction, including without limitation the rights to use, 65 | copy, modify, merge, publish, distribute, sublicense, and/or sell 66 | copies of the Software, and to permit persons to whom the 67 | Software is furnished to do so, subject to the following 68 | conditions: 69 | 70 | The above copyright notice and this permission notice shall be 71 | included in all copies or substantial portions of the Software. 72 | 73 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 74 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 75 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 76 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 77 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 78 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 79 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 80 | OTHER DEALINGS IN THE SOFTWARE. 81 | 82 | --- 83 | 84 | The CommonMark spec (spec.txt) in test/ is 85 | 86 | Copyright (C) 2014-15 John MacFarlane 87 | 88 | Released under the Creative Commons CC-BY-SA 4.0 license: 89 | . 90 | -------------------------------------------------------------------------------- /js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CommonMark dingus 5 | 7 | 8 | 9 |

    The most recent version of the CommonMark dingus can be found 10 | at http://spec.commonmark.org/dingus/.

    12 | 13 | 14 | -------------------------------------------------------------------------------- /make_site_index.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OLDSPECVERSION=$1 4 | SPECVERSION=$2 5 | 6 | VERSIONS=`ls -d -1 0.* | sort -r -g` 7 | 8 | rfcdiff --html --width 80 --stdout $OLDSPECVERSION/spec.txt $SPECVERSION/spec.txt | perl -pe 's/charset=iso-8859-1/charset=utf-8/' > $SPECVERSION/changes.html 9 | 10 | echo "% CommonMark Spec" 11 | echo "" 12 | date=`grep '
    ' $SPECVERSION/index.html | perl -pe 's/^.*(\d\d\d\d-\d\d-\d\d).*$/\1/'` 13 | echo "[**Latest version ($SPECVERSION)**](current/) ($date)" 14 | echo "" 15 | echo "[discussion forum](http://talk.commonmark.org/) | " 16 | echo "[interactive dingus](dingus/) | " 17 | echo "[repository](https://github.com/commonmark/commonmark-spec/) | " 18 | echo "[changelog](changelog.txt)" 19 | echo "" 20 | echo "All versions:" 21 | echo "" 22 | for vers in $VERSIONS 23 | do 24 | date=`grep '
    ' $vers/index.html | perl -pe 's/^.*(\d\d\d\d-\d\d-\d\d).*$/\1/'` 25 | if [ "$vers" != "$SPECVERSION" ]; then 26 | perl -p -i -e 's/
    .*?<\/div>/
    This is an older version of the spec. For the most recent version, see http:\/\/spec.commonmark.org<\/a>.<\/div>/' $vers/index.html 27 | fi 28 | changes="" 29 | [ -f $vers/changes.html ] && changes=" ([view changes]($vers/changes.html 'See changes from previous version') | [test cases]($vers/spec.json 'JSON test cases'))" 30 | echo "- [$vers]($vers/) ($date)$changes" 31 | done | sort -r -k3 32 | -------------------------------------------------------------------------------- /template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $title$ 6 | 72 | 73 | 74 | 75 | $if(title)$ 76 |

    $title$

    77 | $endif$ 78 | $if(version)$ 79 |
    Version $version$ ($date$)
    80 | $endif$ 81 |
    82 | $for(author)$$author$$sep$; $endfor$ 83 |
    84 |
    99 |
    100 | $toc$ 101 |
    102 |
    103 | $body$ 104 | 105 | 106 | --------------------------------------------------------------------------------