From ffd30efe993eb2094ee731f983418e11e4edb911 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Tue, 13 Sep 2016 16:08:11 +0300 Subject: [PATCH] Update CommonMark spec to 0.26 --- test/fixtures/commonmark/bad.txt | 352 +++++++ test/fixtures/commonmark/good.txt | 1512 +++++++++++++---------------- test/fixtures/commonmark/spec.txt | 528 ++++++---- 3 files changed, 1341 insertions(+), 1051 deletions(-) diff --git a/test/fixtures/commonmark/bad.txt b/test/fixtures/commonmark/bad.txt index e69de29..2557004 100644 --- a/test/fixtures/commonmark/bad.txt +++ b/test/fixtures/commonmark/bad.txt @@ -0,0 +1,352 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 387 + +. +- foo + + bar +. + +. + +error: + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 410 + +. +> foo +. +
+
  foo
+
+
+. + +error: + +
+
	foo
+
+
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 419 + +. +- foo +. + +. + +error: + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 458 + +. +# Foo +. +

Foo

+. + +error: + +

# Foo

+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3821 + +. +- foo + + + bar +. + +. + +error: + + +

bar

+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 3866 + +. +- Foo + + bar + + + baz +. + +. + +error: + + +
  baz
+
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4214 + +. +foo +* + +foo +1. +. +

foo +*

+

foo +1.

+. + +error: + +

foo

+ +

foo

+
    +
  1. +
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4866 + +. +The number of windows in my house is +14. The number of doors is 6. +. +

The number of windows in my house is +14. The number of doors is 6.

+. + +error: + +

The number of windows in my house is

+
    +
  1. The number of doors is 6.
  2. +
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4890 + +. +- foo + +- bar + + +- baz +. + +. + +error: + + + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 4911 + +. +- foo + - bar + - baz + + + bim +. + +. + +error: + + +
  bim
+
+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 6137 + +. +*foo bar +* +. +

*foo bar +*

+. + +error: + +

*foo bar

+ + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 6546 + +. +*foo**bar**baz* +. +

foobarbaz

+. + +error: + +

foobarbaz

+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 6585 + +. +*foo**bar*** +. +

foobar

+. + +error: + +

foobar**

+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 6592 + +. +*foo**bar*** +. +

foobar

+. + +error: + +

foobar**

+ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 6690 + +. +**foo*bar*baz** +. +

foobarbaz

+. + +error: + +

foobarbaz**

+ + diff --git a/test/fixtures/commonmark/good.txt b/test/fixtures/commonmark/good.txt index 71c0264..14a4540 100644 --- a/test/fixtures/commonmark/good.txt +++ b/test/fixtures/commonmark/good.txt @@ -1,5 +1,5 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 264 +src line: 347 . foo baz bim @@ -9,7 +9,7 @@ src line: 264 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 272 +src line: 354 . foo baz bim @@ -19,7 +19,7 @@ src line: 272 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 280 +src line: 361 . a a @@ -31,7 +31,7 @@ src line: 280 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 290 +src line: 374 . - foo @@ -47,30 +47,49 @@ src line: 290 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 304 +src line: 431 . -> foo bar + foo + bar . -
-

foo bar

-
+
foo
+bar
+
. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 313 +src line: 440 . - foo - bar + - foo + - bar + - baz . -
foo
-bar
-
+ +. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src line: 464 + +. +* * * +. +
. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 344 +src line: 491 . - `one @@ -83,7 +102,7 @@ src line: 344 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 383 +src line: 530 . *** @@ -96,7 +115,7 @@ ___ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 396 +src line: 543 . +++ @@ -105,7 +124,7 @@ src line: 396 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 403 +src line: 550 . === @@ -114,7 +133,7 @@ src line: 403 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 412 +src line: 559 . -- @@ -127,7 +146,7 @@ __

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 425 +src line: 572 . *** @@ -140,7 +159,7 @@ src line: 425 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 438 +src line: 585 . *** @@ -150,7 +169,7 @@ src line: 438 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 446 +src line: 593 . Foo @@ -161,7 +180,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 457 +src line: 604 . _____________________________________ @@ -170,7 +189,7 @@ _____________________________________ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 466 +src line: 613 . - - - @@ -179,7 +198,7 @@ src line: 466 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 473 +src line: 620 . ** * ** * ** * ** @@ -188,7 +207,7 @@ src line: 473 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 480 +src line: 627 . - - - - @@ -197,7 +216,7 @@ src line: 480 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 489 +src line: 636 . - - - - @@ -206,7 +225,7 @@ src line: 489 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 498 +src line: 645 . _ _ _ _ a @@ -221,7 +240,7 @@ a------ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 514 +src line: 661 . *-* @@ -230,7 +249,7 @@ src line: 514 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 523 +src line: 670 . - foo @@ -247,7 +266,7 @@ src line: 523 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 540 +src line: 687 . Foo @@ -260,7 +279,7 @@ bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 557 +src line: 704 . Foo @@ -272,7 +291,7 @@ bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 570 +src line: 717 . * Foo @@ -289,7 +308,7 @@ src line: 570 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 587 +src line: 734 . - Foo @@ -304,7 +323,7 @@ src line: 587 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 616 +src line: 763 . # foo @@ -323,7 +342,7 @@ src line: 616 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 635 +src line: 782 . ####### foo @@ -332,7 +351,7 @@ src line: 635 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 650 +src line: 797 . #5 bolt @@ -344,16 +363,7 @@ src line: 650 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 662 - -. -# foo -. -

# foo

-. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 671 +src line: 809 . \## foo @@ -362,7 +372,7 @@ src line: 671 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 680 +src line: 818 . # foo *bar* \*baz\* @@ -371,7 +381,7 @@ src line: 680 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 689 +src line: 827 . # foo @@ -380,7 +390,7 @@ src line: 689 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 698 +src line: 836 . ### foo @@ -393,7 +403,7 @@ src line: 698 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 711 +src line: 849 . # foo @@ -403,7 +413,7 @@ src line: 711 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 719 +src line: 857 . foo @@ -414,7 +424,7 @@ foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 730 +src line: 868 . ## foo ## @@ -425,7 +435,7 @@ src line: 730 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 741 +src line: 879 . # foo ################################## @@ -436,7 +446,7 @@ src line: 741 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 752 +src line: 890 . ### foo ### @@ -445,7 +455,7 @@ src line: 752 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 763 +src line: 901 . ### foo ### b @@ -454,7 +464,7 @@ src line: 763 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 772 +src line: 910 . # foo# @@ -463,7 +473,7 @@ src line: 772 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 782 +src line: 920 . ### foo \### @@ -476,7 +486,7 @@ src line: 782 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 796 +src line: 934 . **** @@ -489,7 +499,7 @@ src line: 796 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 807 +src line: 945 . Foo bar @@ -502,7 +512,7 @@ Bar foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 820 +src line: 958 . ## @@ -515,7 +525,7 @@ src line: 820 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 863 +src line: 1001 . Foo *bar* @@ -529,7 +539,7 @@ Foo *bar* . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 877 +src line: 1015 . Foo *bar @@ -541,7 +551,7 @@ baz . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 889 +src line: 1027 . Foo @@ -555,7 +565,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 904 +src line: 1042 . Foo @@ -573,7 +583,7 @@ src line: 904 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 922 +src line: 1060 . Foo @@ -591,7 +601,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 941 +src line: 1079 . Foo @@ -601,7 +611,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 951 +src line: 1089 . Foo @@ -612,7 +622,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 962 +src line: 1100 . Foo @@ -628,7 +638,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 978 +src line: 1116 . Foo @@ -638,7 +648,7 @@ Foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 988 +src line: 1126 . Foo\ @@ -648,7 +658,7 @@ Foo\ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 999 +src line: 1137 . `Foo @@ -666,7 +676,7 @@ of dashes"/> . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1018 +src line: 1156 . > Foo @@ -679,7 +689,7 @@ src line: 1018 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1029 +src line: 1167 . > foo @@ -694,7 +704,7 @@ bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1042 +src line: 1180 . - Foo @@ -707,7 +717,7 @@ src line: 1042 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1057 +src line: 1195 . Foo @@ -719,7 +729,7 @@ Bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1070 +src line: 1208 . --- @@ -736,7 +746,7 @@ Baz . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1087 +src line: 1225 . @@ -746,7 +756,7 @@ src line: 1087 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1099 +src line: 1237 . --- @@ -757,7 +767,7 @@ src line: 1099 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1108 +src line: 1246 . - foo @@ -770,7 +780,7 @@ src line: 1108 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1119 +src line: 1257 . foo @@ -782,7 +792,7 @@ src line: 1119 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1129 +src line: 1267 . > foo @@ -795,7 +805,7 @@ src line: 1129 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1143 +src line: 1281 . \> foo @@ -805,7 +815,7 @@ src line: 1143 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1174 +src line: 1312 . Foo @@ -820,7 +830,7 @@ baz . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1190 +src line: 1328 . Foo @@ -837,7 +847,7 @@ bar

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1208 +src line: 1346 . Foo @@ -852,7 +862,7 @@ bar

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1223 +src line: 1361 . Foo @@ -867,7 +877,7 @@ baz

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1251 +src line: 1389 . a simple @@ -879,7 +889,7 @@ src line: 1251 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1265 +src line: 1403 . - foo @@ -895,7 +905,7 @@ src line: 1265 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1279 +src line: 1417 . 1. foo @@ -913,7 +923,7 @@ src line: 1279 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1299 +src line: 1437 . @@ -929,7 +939,7 @@ src line: 1299 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1315 +src line: 1453 . chunk1 @@ -951,7 +961,7 @@ chunk3 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1338 +src line: 1476 . chunk1 @@ -965,7 +975,7 @@ src line: 1338 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1353 +src line: 1491 . Foo @@ -977,7 +987,7 @@ bar

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1367 +src line: 1505 . foo @@ -989,7 +999,7 @@ bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1380 +src line: 1518 . # Heading @@ -1009,7 +1019,7 @@ Heading . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1400 +src line: 1538 . foo @@ -1021,7 +1031,7 @@ bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1413 +src line: 1551 . @@ -1035,7 +1045,7 @@ src line: 1413 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1427 +src line: 1565 . foo @@ -1045,7 +1055,7 @@ src line: 1427 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1482 +src line: 1620 . ``` @@ -1059,7 +1069,7 @@ src line: 1482 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1496 +src line: 1634 . ~~~ @@ -1073,7 +1083,7 @@ src line: 1496 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1511 +src line: 1649 . ``` @@ -1087,7 +1097,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1523 +src line: 1661 . ~~~ @@ -1101,7 +1111,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1537 +src line: 1675 . ```` @@ -1115,7 +1125,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1549 +src line: 1687 . ~~~~ @@ -1129,7 +1139,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1564 +src line: 1702 . ``` @@ -1138,7 +1148,7 @@ src line: 1564 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1571 +src line: 1709 . ````` @@ -1153,7 +1163,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1584 +src line: 1722 . > ``` @@ -1169,7 +1179,7 @@ bbb . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1600 +src line: 1738 . ``` @@ -1183,7 +1193,7 @@ src line: 1600 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1614 +src line: 1752 . ``` @@ -1193,7 +1203,7 @@ src line: 1614 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1626 +src line: 1764 . ``` @@ -1207,7 +1217,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1638 +src line: 1776 . ``` @@ -1223,7 +1233,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1652 +src line: 1790 . ``` @@ -1239,7 +1249,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1668 +src line: 1806 . ``` @@ -1253,7 +1263,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1683 +src line: 1821 . ``` @@ -1265,7 +1275,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1693 +src line: 1831 . ``` @@ -1277,7 +1287,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1705 +src line: 1843 . ``` @@ -1290,7 +1300,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1719 +src line: 1857 . ``` ``` @@ -1301,7 +1311,7 @@ aaa

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1728 +src line: 1866 . ~~~~~~ @@ -1314,7 +1324,7 @@ aaa . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1742 +src line: 1880 . foo @@ -1330,7 +1340,7 @@ baz . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1759 +src line: 1897 . foo @@ -1347,7 +1357,7 @@ bar . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1779 +src line: 1917 . ```ruby @@ -1363,7 +1373,7 @@ end . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1793 +src line: 1931 . ~~~~ ruby startline=3 $%@#$ @@ -1379,7 +1389,7 @@ end . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1807 +src line: 1945 . ````; @@ -1389,7 +1399,7 @@ src line: 1807 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1817 +src line: 1955 . ``` aa ``` @@ -1400,7 +1410,7 @@ foo

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1828 +src line: 1966 . ``` @@ -1412,7 +1422,7 @@ src line: 1828 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1902 +src line: 2040 . @@ -1436,7 +1446,7 @@ okay. . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1924 +src line: 2062 .
@@ -1449,7 +1459,7 @@ src line: 1924 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1937 +src line: 2075 .
@@ -1460,7 +1470,7 @@ src line: 1937 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1948 +src line: 2086 .
@@ -1475,7 +1485,7 @@ src line: 1948 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 1964 +src line: 2102 . @@ -1557,7 +1567,7 @@ src line: 2036 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2043 +src line: 2181 .
@@ -1570,7 +1580,7 @@ foo . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2060 +src line: 2198 .
@@ -1585,7 +1595,7 @@ int x = 33; . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2077 +src line: 2215 . @@ -1598,7 +1608,7 @@ src line: 2077 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2090 +src line: 2228 . @@ -1611,7 +1621,7 @@ src line: 2090 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2101 +src line: 2239 . @@ -1624,7 +1634,7 @@ src line: 2101 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2112 +src line: 2250 . @@ -1635,7 +1645,7 @@ src line: 2112 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2127 +src line: 2265 . @@ -1648,7 +1658,7 @@ src line: 2127 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2142 +src line: 2280 . @@ -1663,7 +1673,7 @@ src line: 2142 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2160 +src line: 2298 . *foo* @@ -1672,7 +1682,7 @@ src line: 2160 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2176 +src line: 2314 .

@@ -1681,6 +1691,7 @@ import Text.HTML.TagSoup
 main :: IO ()
 main = print $ parseTags tags
 
+okay .

 import Text.HTML.TagSoup
@@ -1688,10 +1699,11 @@ import Text.HTML.TagSoup
 main :: IO ()
 main = print $ parseTags tags
 
+

okay

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2195 +src line: 2335 . +okay . +

okay

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2212 +src line: 2354 . +

okay

. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2233 +src line: 2377 . @@ -1784,7 +1800,7 @@ src line: 2275 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2284 +src line: 2428 . *bar* @@ -1795,7 +1811,7 @@ src line: 2284 . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -src line: 2296 +src line: 2440 . +okay . +

okay

```````````````````````````````` @@ -2217,6 +2359,7 @@ h1 {color:red;} p {color:blue;} +okay . +

okay

```````````````````````````````` @@ -2312,11 +2456,13 @@ A comment (type 2): bar baz --> +okay . +

okay

```````````````````````````````` @@ -2329,12 +2475,14 @@ A processing instruction (type 3): echo '>'; ?> +okay . '; ?> +

okay

```````````````````````````````` @@ -2362,6 +2510,7 @@ function matchwo(a,b) } } ]]> +okay . +

okay

```````````````````````````````` @@ -3119,8 +3269,8 @@ Four spaces gives us a code block: ```````````````````````````````` -The Laziness clause allows us to omit the `>` before a -paragraph continuation line: +The Laziness clause allows us to omit the `>` before +[paragraph continuation text]: ```````````````````````````````` example > # Foo @@ -3226,8 +3376,8 @@ foo ```````````````````````````````` -Note that in the following case, we have a paragraph -continuation line: +Note that in the following case, we have a [lazy +continuation line]: ```````````````````````````````` example > foo @@ -3249,7 +3399,7 @@ To see why, note that in the `- bar` is indented too far to start a list, and can't be an indented code block because indented code blocks cannot -interrupt paragraphs, so it is a [paragraph continuation line]. +interrupt paragraphs, so it is [paragraph continuation text]. A block quote can be empty: @@ -3478,7 +3628,7 @@ The following rules define [list items]: 1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of blocks *Bs* starting with a [non-whitespace character] and not separated from each other by more than one blank line, and *M* is a list - marker of width *W* followed by 0 < *N* < 5 spaces, then the result + marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces, then the result of prepending *M* and the following spaces to the first line of *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a list item with *Bs* as its contents. The type of the list item @@ -3486,6 +3636,12 @@ The following rules define [list items]: If the list item is ordered, then it is also assigned a start number, based on the ordered list marker. + Exceptions: When the list item interrupts a paragraph---that + is, when it starts on a line that would otherwise count as + [paragraph continuation text]---then (a) the lines *Ls* must + not begin with a blank line, and (b) if the list item is + ordered, the start number must be 1. + For example, let *Ls* be the lines ```````````````````````````````` example @@ -3660,66 +3816,20 @@ any following content, so these are not list items: ```````````````````````````````` -A list item may not contain blocks that are separated by more than -one blank line. Thus, two blank lines will end a list, unless the -two blanks are contained in a [fenced code block]. +A list item may contain blocks that are separated by more than +one blank line. ```````````````````````````````` example -- foo - - bar - - foo bar - -- ``` - foo - - - bar - ``` - -- baz - - + ``` - foo - - - bar - ``` .
  • foo

    bar

  • -
  • -

    foo

    -
  • -
-

bar

-
    -
  • -
    foo
    -
    -
    -bar
    -
    -
  • -
  • -

    baz

    -
      -
    • -
      foo
      -
      -
      -bar
      -
      -
    • -
    -
```````````````````````````````` @@ -3752,15 +3862,14 @@ A list item may contain any kind of block: A list item that contains an indented code block will preserve -empty lines within the code block verbatim, unless there are two -or more empty lines in a row (since as described above, two -blank lines end the list): +empty lines within the code block verbatim. ```````````````````````````````` example - Foo bar + baz .
    @@ -3768,33 +3877,13 @@ blank lines end the list):

    Foo

    bar
     
    -baz
    -
    - -
-```````````````````````````````` - - -```````````````````````````````` example -- Foo - bar - - - baz -. -
    -
  • -

    Foo

    -
    bar
    +baz
     
-
  baz
-
```````````````````````````````` - Note that ordered list start numbers must be nine digits or less: ```````````````````````````````` example @@ -4037,6 +4126,18 @@ Here are some list items that start with a blank line but are not empty: ```````````````````````````````` +When the list item starts with a blank line, the number of spaces +following the list marker doesn't change the required indentation: + +```````````````````````````````` example +- + foo +. +
    +
  • foo
  • +
+```````````````````````````````` + A list item can begin with at most one blank line. In the following example, `foo` is not part of the list @@ -4109,6 +4210,20 @@ A list may start or end with an empty list item: ```````````````````````````````` +However, an empty list item cannot interrupt a paragraph: + +```````````````````````````````` example +foo +* + +foo +1. +. +

foo +*

+

foo +1.

+```````````````````````````````` 4. **Indentation.** If a sequence of lines *Ls* constitutes a list item @@ -4306,13 +4421,18 @@ So, in this case we need two spaces indent: - foo - bar - baz + - boo .
  • foo
    • bar
        -
      • baz
      • +
      • baz +
          +
        • boo
        • +
        +
    @@ -4327,11 +4447,13 @@ One is not enough: - foo - bar - baz + - boo .
    • foo
    • bar
    • baz
    • +
    • boo
    ```````````````````````````````` @@ -4684,28 +4806,20 @@ Foo
```````````````````````````````` - `Markdown.pl` does not allow this, through fear of triggering a list via a numeral in a hard-wrapped line: -```````````````````````````````` example +```````````````````````````````` markdown The number of windows in my house is 14. The number of doors is 6. -. -

The number of windows in my house is

-
    -
  1. The number of doors is 6.
  2. -
```````````````````````````````` +Oddly, though, `Markdown.pl` *does* allow a blockquote to +interrupt a paragraph, even though the same considerations might +apply. - -Oddly, `Markdown.pl` *does* allow a blockquote to interrupt a paragraph, -even though the same considerations might apply. We think that the two -cases should be treated the same. Here are two reasons for allowing -lists to interrupt paragraphs: - -First, it is natural and not uncommon for people to start lists without -blank lines: +In CommonMark, we do allow lists to interrupt paragraphs, for +two reasons. First, it is natural and not uncommon for people +to start lists without blank lines: I need to buy - new shoes @@ -4739,20 +4853,40 @@ then by itself should be a paragraph followed by a nested sublist. -Our adherence to the [principle of uniformity] -thus inclines us to think that there are two coherent packages: +Since it is well established Markdown practice to allow lists to +interrupt paragraphs inside list items, the [principle of +uniformity] requires us to allow this outside list items as +well. ([reStructuredText](http://docutils.sourceforge.net/rst.html) +takes a different approach, requiring blank lines before lists +even inside other list items.) -1. Require blank lines before *all* lists and blockquotes, - including lists that occur as sublists inside other list items. +In order to solve of unwanted lists in paragraphs with +hard-wrapped numerals, we allow only lists starting with `1` to +interrupt paragraphs. Thus, -2. Require blank lines in none of these places. +```````````````````````````````` example +The number of windows in my house is +14. The number of doors is 6. +. +

The number of windows in my house is +14. The number of doors is 6.

+```````````````````````````````` -[reStructuredText](http://docutils.sourceforge.net/rst.html) takes -the first approach, for which there is much to be said. But the second -seems more consistent with established practice with Markdown. +We may still get an unintended result in cases like -There can be blank lines between items, but two blank lines end -a list: +```````````````````````````````` example +The number of windows in my house is +1. The number of doors is 6. +. +

The number of windows in my house is

+
    +
  1. The number of doors is 6.
  2. +
+```````````````````````````````` + +but this rule should prevent most spurious list captures. + +There can be any number of blank lines between items: ```````````````````````````````` example - foo @@ -4769,36 +4903,12 @@ a list:
  • bar

  • - -
      -
    • baz
    • +
    • +

      baz

      +
    ```````````````````````````````` - -As illustrated above in the section on [list items], -two blank lines between blocks *within* a list item will also end a -list: - -```````````````````````````````` example -- foo - - - bar -- baz -. -
      -
    • foo
    • -
    -

    bar

    -
      -
    • baz
    • -
    -```````````````````````````````` - - -Indeed, two blank lines will end *all* containing lists: - ```````````````````````````````` example - foo - bar @@ -4812,26 +4922,28 @@ Indeed, two blank lines will end *all* containing lists:
    • bar
        -
      • baz
      • +
      • +

        baz

        +

        bim

        +
    -
      bim
    -
    ```````````````````````````````` -Thus, two blank lines can be used to separate consecutive lists of -the same type, or to separate a list from an indented code block -that would otherwise be parsed as a subparagraph of the final list -item: +To separate consecutive lists of the same type, or to separate a +list from an indented code block that would otherwise be parsed +as a subparagraph of the final list item, you can insert a blank HTML +comment: ```````````````````````````````` example - foo - bar + - baz - bim @@ -4840,6 +4952,7 @@ item:
  • foo
  • bar
  • +
    • baz
    • bim
    • @@ -4854,6 +4967,7 @@ item: - foo + code . @@ -4866,6 +4980,7 @@ item:

      foo

    +
    code
     
    ```````````````````````````````` @@ -5812,18 +5927,22 @@ The following rules define emphasis and strong emphasis: 9. Emphasis begins with a delimiter that [can open emphasis] and ends with a delimiter that [can close emphasis], and that uses the same - character (`_` or `*`) as the opening delimiter. There must - be a nonempty sequence of inlines between the open delimiter - and the closing delimiter; these form the contents of the emphasis - inline. + character (`_` or `*`) as the opening delimiter. The + opening and closing delimiters must belong to separate + [delimiter runs]. If one of the delimiters can both + open and close emphasis, then the sum of the lengths of the + delimiter runs containing the opening and closing delimiters + must not be a multiple of 3. 10. Strong emphasis begins with a delimiter that [can open strong emphasis] and ends with a delimiter that [can close strong emphasis], and that uses the same character - (`_` or `*`) as the opening delimiter. - There must be a nonempty sequence of inlines between the open - delimiter and the closing delimiter; these form the contents of - the strong emphasis inline. + (`_` or `*`) as the opening delimiter. The + opening and closing delimiters must belong to separate + [delimiter runs]. If one of the delimiters can both open + and close strong emphasis, then the sum of the lengths of + the delimiter runs containing the opening and closing + delimiters must not be a multiple of 3. 11. A literal `*` character cannot occur at the beginning or end of `*`-delimited emphasis or `**`-delimited strong emphasis, unless it @@ -5847,9 +5966,7 @@ the following principles resolve ambiguity: so that the second begins before the first ends and ends after the first ends, the first takes precedence. Thus, for example, `*foo _bar* baz_` is parsed as `foo _bar baz_` rather - than `*foo bar* baz`. For the same reason, - `**foo*bar**` is parsed as `foobar*` - rather than `foo*bar`. + than `*foo bar* baz`. 16. When there are two potential emphasis or strong emphasis spans with the same closing delimiter, the shorter one (the one that @@ -6022,10 +6139,8 @@ A newline also counts as whitespace: *foo bar * . -

    *foo bar

    -
      -
    • -
    +

    *foo bar +*

    ```````````````````````````````` @@ -6429,18 +6544,30 @@ __foo_ bar_

    foo bar baz

    ```````````````````````````````` - -But note: - ```````````````````````````````` example *foo**bar**baz* . -

    foobarbaz

    +

    foobarbaz

    ```````````````````````````````` +Note that in the preceding case, the interpretation + +``` markdown +

    foobarbaz

    +``` + + +is precluded by the condition that a delimiter that +can both open and close (like the `*` after `foo` +cannot form emphasis if the sum of the lengths of +the delimiter runs containing the opening and +closing delimiters is a multiple of 3. + +The same condition ensures that the following +cases are all strong emphasis nested inside +emphasis, even when the interior spaces are +omitted: -The difference is that in the preceding case, the internal delimiters -[can close emphasis], while in the cases with spaces, they cannot. ```````````````````````````````` example ***foo** bar* @@ -6456,17 +6583,18 @@ The difference is that in the preceding case, the internal delimiters ```````````````````````````````` -Note, however, that in the following case we get no strong -emphasis, because the opening delimiter is closed by the first -`*` before `bar`: - ```````````````````````````````` example *foo**bar*** . -

    foobar**

    +

    foobar

    ```````````````````````````````` +```````````````````````````````` example +*foo**bar*** +. +

    foobar

    +```````````````````````````````` Indefinite levels of nesting are possible: @@ -6560,18 +6688,13 @@ ____foo__ bar__ ```````````````````````````````` -But note: - ```````````````````````````````` example **foo*bar*baz** . -

    foobarbaz**

    +

    foobarbaz

    ```````````````````````````````` -The difference is that in the preceding case, the internal delimiters -[can close emphasis], while in the cases with spaces, they cannot. - ```````````````````````````````` example ***foo* bar** . @@ -6886,13 +7009,6 @@ Rule 15: ```````````````````````````````` -```````````````````````````````` example -**foo*bar** -. -

    foobar*

    -```````````````````````````````` - - ```````````````````````````````` example *foo __bar *baz bim__ bam* . @@ -7823,7 +7939,7 @@ consists of a [link label] that [matches] a [link reference definition] elsewhere in the document and is not followed by `[]` or a link label. The contents of the first link label are parsed as inlines, -which are used as the link's text. the link's URI and title +which are used as the link's text. The link's URI and title are provided by the matching link reference definition. Thus, `[foo]` is equivalent to `[foo][]`. @@ -8798,7 +8914,7 @@ foo A regular line break (not in a code span or HTML tag) that is not preceded by two or more spaces or a backslash is parsed as a -softbreak. (A softbreak may be rendered in HTML either as a +[softbreak](@). (A softbreak may be rendered in HTML either as a [line ending] or as a space. The result will be the same in browsers. In the examples here, a [line ending] will be used.) @@ -8940,7 +9056,7 @@ This is text that can be incorporated into the last open block (a paragraph, code block, heading, or raw HTML). 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; the accumulated text lines are parsed to see if they begin with