Browse Source

Update CommonMark spec to 0.7

pull/14/head
Alex Kocharin 10 years ago
parent
commit
448dbbd723
  1. 10
      test/fixtures/commonmark/bad.txt
  2. 432
      test/fixtures/commonmark/good.txt
  3. 36
      test/fixtures/commonmark/spec.txt

10
test/fixtures/commonmark/bad.txt

@ -59,7 +59,7 @@ baz</li>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src line: 5583 src line: 5603
. .
![foo *bar*] ![foo *bar*]
@ -75,7 +75,7 @@ error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src line: 5591 src line: 5611
. .
![foo *bar*][] ![foo *bar*][]
@ -91,7 +91,7 @@ error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src line: 5599 src line: 5619
. .
![foo *bar*][foobar] ![foo *bar*][foobar]
@ -107,7 +107,7 @@ error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src line: 5659 src line: 5679
. .
![*foo* bar][] ![*foo* bar][]
@ -123,7 +123,7 @@ error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src line: 5699 src line: 5719
. .
![*foo* bar] ![*foo* bar]

432
test/fixtures/commonmark/good.txt

File diff suppressed because it is too large

36
test/fixtures/commonmark/spec.txt

@ -2,8 +2,8 @@
title: CommonMark Spec title: CommonMark Spec
author: author:
- John MacFarlane - John MacFarlane
version: 0.6 version: 0.7
date: 2014-10-26 date: 2014-10-28
... ...
# Introduction # Introduction
@ -4328,15 +4328,21 @@ the following principles resolve ambiguity:
12. An interpretation `<strong><em>...</em></strong>` is always 12. An interpretation `<strong><em>...</em></strong>` is always
preferred to `<em><strong>..</strong></em>`. preferred to `<em><strong>..</strong></em>`.
13. Earlier closings are preferred to later closings. Thus, 13. When two potential emphasis or strong emphasis spans overlap,
when two potential emphasis or strong emphasis spans overlap, so that the second begins before the first ends and ends after
the first takes precedence: for example, `*foo _bar* baz_` the first ends, the first is preferred. Thus, for example,
is parsed as `<em>foo _bar</em> baz_` rather than `*foo _bar* baz_` is parsed as `<em>foo _bar</em> baz_` rather
`*foo <em>bar* baz</em>`. For the same reason, than `*foo <em>bar* baz</em>`. For the same reason,
`**foo*bar**` is parsed as `<em><em>foo</em>bar</em>*` `**foo*bar**` is parsed as `<em><em>foo</em>bar</em>*`
rather than `<strong>foo*bar</strong>`. rather than `<strong>foo*bar</strong>`.
14. Inline code spans, links, images, and HTML tags group more tightly 14. When there are two potential emphasis or strong emphasis spans
with the same closing delimiter, the shorter one (the one that
opens later) is preferred. Thus, for example,
`**foo **bar baz**` is parsed as `**foo <strong>bar baz</strong>`
rather than `<strong>foo **bar baz</strong>`.
15. Inline code spans, links, images, and HTML tags group more tightly
than emphasis. So, when there is a choice between an interpretation than emphasis. So, when there is a choice between an interpretation
that contains one of these elements and one that does not, the that contains one of these elements and one that does not, the
former always wins. Thus, for example, `*[foo*](bar)` is former always wins. Thus, for example, `*[foo*](bar)` is
@ -4969,6 +4975,20 @@ The following cases illustrate rule 13:
The following cases illustrate rule 14: The following cases illustrate rule 14:
.
**foo **bar baz**
.
<p>**foo <strong>bar baz</strong></p>
.
.
*foo *bar baz*
.
<p>*foo <em>bar baz</em></p>
.
The following cases illustrate rule 15:
. .
*[foo*](bar) *[foo*](bar)
. .

Loading…
Cancel
Save