1s autopkgtest [17:00:35]: starting date and time: 2025-10-18 17:00:35+0000 1s autopkgtest [17:00:35]: git checkout: 4b346b80 nova: make wait_reboot return success even when a no-op 1s autopkgtest [17:00:35]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.asnepme3/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python3-defaults --apt-upgrade commonmark-bkrs --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python3-defaults/3.13.7-2 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-s390x --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@bos03-s390x-7.secgroup --name adt-resolute-s390x-commonmark-bkrs-20251018-170034-juju-7f2275-prod-proposed-migration-environment-2-4a4dfdd2-7d71-40af-82b9-2dd18e2d0666 --image adt/ubuntu-resolute-s390x-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-proposed-migration-s390x -e TERM=linux --mirror=http://ftpmaster.internal/ubuntu/ 5s Creating nova instance adt-resolute-s390x-commonmark-bkrs-20251018-170034-juju-7f2275-prod-proposed-migration-environment-2-4a4dfdd2-7d71-40af-82b9-2dd18e2d0666 from image adt/ubuntu-resolute-s390x-server-20251018.img (UUID c47ab411-f9be-46ce-b861-20d934d06dba)... 58s autopkgtest [17:01:32]: testbed dpkg architecture: s390x 58s autopkgtest [17:01:32]: testbed apt version: 3.1.6ubuntu2 59s autopkgtest [17:01:33]: @@@@@@@@@@@@@@@@@@@@ test bed setup 59s autopkgtest [17:01:33]: testbed release detected to be: None 60s autopkgtest [17:01:34]: updating testbed package index (apt update) 60s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [83.3 kB] 60s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 60s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 60s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 60s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [15.4 kB] 60s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [345 kB] 61s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [5028 B] 61s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [28.4 kB] 61s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main s390x Packages [74.0 kB] 61s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/restricted s390x Packages [940 B] 61s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/universe s390x Packages [226 kB] 61s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse s390x Packages [3812 B] 61s Fetched 781 kB in 1s (843 kB/s) 61s Reading package lists... 62s Hit:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease 62s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 62s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 62s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 63s Reading package lists... 63s Reading package lists... 63s Building dependency tree... 63s Reading state information... 63s Calculating upgrade... 63s The following packages will be upgraded: 63s apt gir1.2-girepository-2.0 libapt-pkg7.0 libgirepository-1.0-1 63s libpython3-stdlib lto-disabled-list python3 python3-minimal 63s 8 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 63s Need to get 2763 kB of archives. 63s After this operation, 14.3 kB of additional disk space will be used. 63s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main s390x python3-minimal s390x 3.13.7-2 [27.8 kB] 63s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main s390x python3 s390x 3.13.7-2 [23.9 kB] 63s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main s390x libpython3-stdlib s390x 3.13.7-2 [10.6 kB] 63s Get:4 http://ftpmaster.internal/ubuntu resolute/main s390x libapt-pkg7.0 s390x 3.1.8ubuntu1 [1144 kB] 64s Get:5 http://ftpmaster.internal/ubuntu resolute/main s390x apt s390x 3.1.8ubuntu1 [1432 kB] 64s Get:6 http://ftpmaster.internal/ubuntu resolute/main s390x libgirepository-1.0-1 s390x 1.86.0-6 [86.9 kB] 64s Get:7 http://ftpmaster.internal/ubuntu resolute/main s390x gir1.2-girepository-2.0 s390x 1.86.0-6 [25.1 kB] 64s Get:8 http://ftpmaster.internal/ubuntu resolute/main s390x lto-disabled-list all 71 [12.5 kB] 64s dpkg-preconfigure: unable to re-open stdin: No such file or directory 64s Fetched 2763 kB in 1s (3035 kB/s) 64s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 56852 files and directories currently installed.) 64s Preparing to unpack .../python3-minimal_3.13.7-2_s390x.deb ... 64s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 64s Setting up python3-minimal (3.13.7-2) ... 65s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 56852 files and directories currently installed.) 65s Preparing to unpack .../0-python3_3.13.7-2_s390x.deb ... 65s running python pre-rtupdate hooks for python3.13... 65s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 65s Preparing to unpack .../1-libpython3-stdlib_3.13.7-2_s390x.deb ... 65s Unpacking libpython3-stdlib:s390x (3.13.7-2) over (3.13.7-1) ... 65s Preparing to unpack .../2-libapt-pkg7.0_3.1.8ubuntu1_s390x.deb ... 65s Unpacking libapt-pkg7.0:s390x (3.1.8ubuntu1) over (3.1.6ubuntu2) ... 65s Preparing to unpack .../3-apt_3.1.8ubuntu1_s390x.deb ... 65s Unpacking apt (3.1.8ubuntu1) over (3.1.6ubuntu2) ... 65s Preparing to unpack .../4-libgirepository-1.0-1_1.86.0-6_s390x.deb ... 65s Unpacking libgirepository-1.0-1:s390x (1.86.0-6) over (1.84.0-1) ... 65s Preparing to unpack .../5-gir1.2-girepository-2.0_1.86.0-6_s390x.deb ... 65s Unpacking gir1.2-girepository-2.0:s390x (1.86.0-6) over (1.84.0-1) ... 65s Preparing to unpack .../6-lto-disabled-list_71_all.deb ... 65s Unpacking lto-disabled-list (71) over (69) ... 65s Setting up lto-disabled-list (71) ... 65s Setting up libgirepository-1.0-1:s390x (1.86.0-6) ... 65s Setting up libapt-pkg7.0:s390x (3.1.8ubuntu1) ... 65s Setting up libpython3-stdlib:s390x (3.13.7-2) ... 65s Setting up apt (3.1.8ubuntu1) ... 65s Setting up python3 (3.13.7-2) ... 65s running python rtupdate hooks for python3.13... 65s running python post-rtupdate hooks for python3.13... 65s Setting up gir1.2-girepository-2.0:s390x (1.86.0-6) ... 65s Processing triggers for man-db (2.13.1-1) ... 67s Processing triggers for libc-bin (2.42-0ubuntu3) ... 67s autopkgtest [17:01:41]: upgrading testbed (apt dist-upgrade and autopurge) 68s Reading package lists... 68s Building dependency tree... 68s Reading state information... 68s Calculating upgrade... 68s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 68s Reading package lists... 68s Building dependency tree... 68s Reading state information... 68s Solving dependencies... 69s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 69s autopkgtest [17:01:43]: rebooting testbed after setup commands that affected boot 82s autopkgtest [17:01:56]: testbed running kernel: Linux 6.17.0-5-generic #5-Ubuntu SMP Mon Sep 22 08:56:47 UTC 2025 85s autopkgtest [17:01:59]: @@@@@@@@@@@@@@@@@@@@ apt-source commonmark-bkrs 87s Get:1 http://ftpmaster.internal/ubuntu resolute/universe commonmark-bkrs 0.5.4+ds-7.1 (dsc) [2272 B] 87s Get:2 http://ftpmaster.internal/ubuntu resolute/universe commonmark-bkrs 0.5.4+ds-7.1 (tar) [81.9 kB] 87s Get:3 http://ftpmaster.internal/ubuntu resolute/universe commonmark-bkrs 0.5.4+ds-7.1 (diff) [6860 B] 87s gpgv: Signature made Thu Feb 8 00:40:02 2024 UTC 87s gpgv: using RSA key D56571B88A8BBAF140BF63D6BD7EAA60778FA6F5 87s gpgv: issuer "doko@debian.org" 87s gpgv: Can't check signature: No public key 87s dpkg-source: warning: cannot verify inline signature for ./commonmark-bkrs_0.5.4+ds-7.1.dsc: no acceptable signature found 87s autopkgtest [17:02:01]: testing package commonmark-bkrs version 0.5.4+ds-7.1 87s autopkgtest [17:02:01]: build not needed 88s autopkgtest [17:02:02]: test command1: preparing testbed 88s Reading package lists... 88s Building dependency tree... 88s Reading state information... 88s Solving dependencies... 88s The following NEW packages will be installed: 88s python-commonmark-bkrs-doc python3-commonmark-bkrs 88s 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 88s Need to get 95.7 kB of archives. 88s After this operation, 1084 kB of additional disk space will be used. 88s Get:1 http://ftpmaster.internal/ubuntu resolute/universe s390x python-commonmark-bkrs-doc all 0.5.4+ds-7.1 [64.2 kB] 89s Get:2 http://ftpmaster.internal/ubuntu resolute/universe s390x python3-commonmark-bkrs all 0.5.4+ds-7.1 [31.4 kB] 89s Fetched 95.7 kB in 0s (268 kB/s) 89s Selecting previously unselected package python-commonmark-bkrs-doc. 89s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 56852 files and directories currently installed.) 89s Preparing to unpack .../python-commonmark-bkrs-doc_0.5.4+ds-7.1_all.deb ... 89s Unpacking python-commonmark-bkrs-doc (0.5.4+ds-7.1) ... 89s Selecting previously unselected package python3-commonmark-bkrs. 89s Preparing to unpack .../python3-commonmark-bkrs_0.5.4+ds-7.1_all.deb ... 89s Unpacking python3-commonmark-bkrs (0.5.4+ds-7.1) ... 89s Setting up python-commonmark-bkrs-doc (0.5.4+ds-7.1) ... 89s Setting up python3-commonmark-bkrs (0.5.4+ds-7.1) ... 89s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:186: SyntaxWarning: invalid escape sequence '\s' 89s return bool(re.compile("^\s*$").match(s)) 89s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:338: SyntaxWarning: invalid escape sequence '\/' 89s "^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>") 89s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:385: SyntaxWarning: invalid escape sequence '\s' 89s numdelims <= 3) and (not re.match("\s", char_after)) 89s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:387: SyntaxWarning: invalid escape sequence '\s' 89s numdelims <= 3) and (not re.match("\s", char_before)) 89s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:1008: SyntaxWarning: invalid escape sequence '\g' 89s re.sub(r'(?:(\\#) *#*| *#+) *$', '\g<1>', ln[offset:])] 89s Processing triggers for man-db (2.13.1-1) ... 91s autopkgtest [17:02:05]: test command1: cd /usr/share/doc/python-commonmark-bkrs-doc/tests/ && python3 test-CommonMark.py 91s autopkgtest [17:02:05]: test command1: [----------------------- 91s /usr/share/doc/python-commonmark-bkrs-doc/examples/tests/test-CommonMark.py:67: SyntaxWarning: invalid escape sequence '\.' 91s testMatch = re.findall(re.compile("^\.\n([\s\S]*?)^\.\n([\s\S]*?)^.$|^#{1,6} *(.*)$", re.M), tests) 91s [95m[Preprocessing][0m 91s Test #1 91s [92mtick[0m 91s Test #2 91s [92mtick[0m 91s [95m[Precedence][0m 91s Test #3 91s [92mtick[0m 91s [95m[Horizontal rules][0m 91s Test #4 91s [92mtick[0m 91s Test #5 91s [92mtick[0m 91s Test #6 91s [92mtick[0m 91s Test #7 91s [92mtick[0m 91s Test #8 91s [92mtick[0m 91s Test #9 91s [92mtick[0m 91s Test #10 91s [92mtick[0m 91s Test #11 91s [92mtick[0m 91s Test #12 91s [92mtick[0m 91s Test #13 91s [92mtick[0m 91s Test #14 91s [92mtick[0m 91s Test #15 91s [92mtick[0m 91s Test #16 91s [92mtick[0m 91s Test #17 91s [92mtick[0m 91s Test #18 91s [92mtick[0m 91s Test #19 91s [92mtick[0m 91s Test #20 91s [92mtick[0m 91s Test #21 91s [92mtick[0m 91s Test #22 91s [92mtick[0m 91s [95m[ATX headers][0m 91s Test #23 91s [92mtick[0m 91s Test #24 91s [92mtick[0m 91s Test #25 91s [92mtick[0m 91s Test #26 91s [92mtick[0m 91s Test #27 91s [92mtick[0m 91s Test #28 91s [92mtick[0m 91s Test #29 91s [92mtick[0m 91s Test #30 91s [92mtick[0m 91s Test #31 91s [92mtick[0m 91s Test #32 91s [92mtick[0m 91s Test #33 91s [92mtick[0m 91s Test #34 91s [92mtick[0m 91s Test #35 91s [92mtick[0m 91s Test #36 91s [92mtick[0m 91s Test #37 91s [92mtick[0m 91s Test #38 91s [92mtick[0m 91s Test #39 91s [92mtick[0m 91s [95m[Setext headers][0m 91s Test #40 91s [92mtick[0m 91s Test #41 91s [92mtick[0m 91s Test #42 91s [92mtick[0m 91s Test #43 91s [92mtick[0m 91s Test #44 91s [92mtick[0m 91s Test #45 91s [92mtick[0m 91s Test #46 91s [92mtick[0m 91s Test #47 91s [92mtick[0m 91s Test #48 91s [92mtick[0m 91s Test #49 91s [92mtick[0m 91s Test #50 91s [92mtick[0m 91s Test #51 91s [92mtick[0m 91s Test #52 91s [92mtick[0m 91s Test #53 91s [92mtick[0m 91s [95m[Indented code blocks][0m 91s Test #54 91s [92mtick[0m 91s Test #55 91s [92mtick[0m 91s Test #56 91s [92mtick[0m 91s Test #57 91s [92mtick[0m 91s Test #58 91s [92mtick[0m 91s Test #59 91s [92mtick[0m 91s Test #60 91s [92mtick[0m 91s Test #61 91s [92mtick[0m 91s Test #62 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s ␣␣␣␣ 91s ␣␣␣␣foo 91s ␣␣␣␣ 91s 91s [93m 91s === expected =============== 91s [0m
foo
91s
91s [93m
91s === got ====================
91s [0mfoo
91s
91s
91s
91s Test #63
91s [92mtick[0m
91s [95m[Fenced code blocks][0m
91s Test #64
91s [92mtick[0m
91s Test #65
91s [92mtick[0m
91s Test #66
91s [92mtick[0m
91s Test #67
91s [92mtick[0m
91s Test #68
91s [92mtick[0m
91s Test #69
91s [92mtick[0m
91s Test #70
91s [92mtick[0m
91s Test #71
91s [92mtick[0m
91s Test #72
91s [92mtick[0m
91s Test #73
91s [92mtick[0m
91s Test #74
91s [92mtick[0m
91s Test #75
91s [92mtick[0m
91s Test #76
91s [92mtick[0m
91s Test #77
91s [92mtick[0m
91s Test #78
91s [92mtick[0m
91s Test #79
91s [92mtick[0m
91s Test #80
91s [92mtick[0m
91s Test #81
91s [92mtick[0m
91s Test #82
91s [92mtick[0m
91s Test #83
91s [92mtick[0m
91s Test #84
91s [92mtick[0m
91s Test #85
91s [92mtick[0m
91s Test #86
91s [92mtick[0m
91s [95m[HTML blocks][0m
91s Test #87
91s [92mtick[0m
91s Test #88
91s [92mtick[0m
91s Test #89
91s [92mtick[0m
91s Test #90
91s [92mtick[0m
91s Test #91
91s [92mtick[0m
91s Test #92
91s [92mtick[0m
91s Test #93
91s [91mcross[0m
91s [93m=== markdown ===============
91s [0m
91s [93m
91s === expected ===============
91s [0m
91s
91s Test #94
91s [91mcross[0m
91s [93m=== markdown ===============
91s [0m
91s The␣opening␣tag␣can␣be␣indented␣1-3␣spaces,␣but␣not␣4:
91s
91s [93m
91s === expected ===============
91s [0m␣␣
91s
91s ␣␣␣␣
91s [93m
91s === got ====================
91s [0mThe␣opening␣tag␣can␣be␣indented␣1-3␣spaces,␣but␣not␣4:
91s 91s Test #95 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s An␣HTML␣block␣can␣interrupt␣a␣paragraph,␣and␣need␣not␣be␣preceded 91s by␣a␣blank␣line. 91s 91s [93m 91s === expected =============== 91s [0mFoo 91sAn␣HTML␣block␣can␣interrupt␣a␣paragraph,␣and␣need␣not␣be␣preceded 91s by␣a␣blank␣line.
91s 91s Test #96 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s However,␣a␣following␣blank␣line␣is␣always␣needed,␣except␣at␣the␣end␣of 91s a␣document: 91s 91s [93m 91s === expected =============== 91s [0mHowever,␣a␣following␣blank␣line␣is␣always␣needed,␣except␣at␣the␣end␣of 91s a␣document:
91s 91s Test #97 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s An␣incomplete␣HTML␣block␣tag␣may␣also␣start␣an␣HTML␣block: 91s 91s [93m 91s === expected =============== 91s [0m| 91s Hi 91s | 91s 91s
Some␣Markdown␣implementations␣have␣adopted␣a␣convention␣of
91s interpreting␣content␣inside␣tags␣as␣text␣if␣the␣open␣tag␣has
91s the␣attribute␣markdown=1.␣␣The␣rule␣given␣above␣seems␣a␣simpler␣and
91s more␣elegant␣way␣of␣achieving␣the␣same␣expressive␣power,␣which␣is␣also
91s much␣simpler␣to␣parse.
The␣main␣potential␣drawback␣is␣that␣one␣can␣no␣longer␣paste␣HTML 91s blocks␣into␣Markdown␣documents␣with␣100%␣reliability.␣␣However, 91s in␣most␣cases␣this␣will␣work␣fine,␣because␣the␣blank␣lines␣in 91s HTML␣are␣usually␣followed␣by␣HTML␣block␣tags.␣␣For␣example:
91s 91s Test #101 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Moreover,␣blank␣lines␣are␣usually␣not␣necessary␣and␣can␣be 91s deleted.␣␣The␣exception␣is␣inside␣``␣tags;␣here,␣one␣can 91s replace␣the␣blank␣lines␣with␣` `␣entities. 91s 91s So␣there␣is␣no␣important␣loss␣of␣expressive␣power␣with␣the␣new␣rule. 91s 91s ##␣Link␣reference␣definitions 91s 91s A␣[link␣reference␣definition](#link-reference-definition) 91s ␣consists␣of␣a␣[link 91s label](#link-label),␣indented␣up␣to␣three␣spaces,␣followed 91s by␣a␣colon␣(`:`),␣optional␣blank␣space␣(including␣up␣to␣one 91s newline),␣a␣[link␣destination](#link-destination),␣optional 91s blank␣space␣(including␣up␣to␣one␣newline),␣and␣an␣optional␣[link 91s title](#link-title),␣which␣if␣it␣is␣present␣must␣be␣separated 91s from␣the␣[link␣destination](#link-destination)␣by␣whitespace. 91s No␣further␣non-space␣characters␣may␣occur␣on␣the␣line. 91s 91s A␣[link␣reference-definition](#link-reference-definition) 91s does␣not␣correspond␣to␣a␣structural␣element␣of␣a␣document.␣␣Instead,␣it 91s defines␣a␣label␣which␣can␣be␣used␣in␣[reference␣links](#reference-link) 91s and␣reference-style␣[images](#image)␣elsewhere␣in␣the␣document.␣␣[Link 91s reference␣definitions]␣can␣come␣either␣before␣or␣after␣the␣links␣that␣use 91s them. 91s 91s [93m 91s === expected =============== 91s [0m[foo]:␣/url␣"title" 91s 91s [foo] 91s [93m 91s === got ==================== 91s [0mMoreover,␣blank␣lines␣are␣usually␣not␣necessary␣and␣can␣be 91s deleted.␣␣The␣exception␣is␣inside␣
91s<pre>␣tags;␣here,␣one␣can 91s replace␣the␣blank␣lines␣with␣ ␣entities.So␣there␣is␣no␣important␣loss␣of␣expressive␣power␣with␣the␣new␣rule.
91sLink␣reference␣definitions
91sA␣link␣reference␣definition 91s ␣consists␣of␣a␣link 91s label,␣indented␣up␣to␣three␣spaces,␣followed 91s by␣a␣colon␣(
91s:),␣optional␣blank␣space␣(including␣up␣to␣one 91s newline),␣a␣link␣destination,␣optional 91s blank␣space␣(including␣up␣to␣one␣newline),␣and␣an␣optional␣link 91s title,␣which␣if␣it␣is␣present␣must␣be␣separated 91s from␣the␣link␣destination␣by␣whitespace. 91s No␣further␣non-space␣characters␣may␣occur␣on␣the␣line.A␣link␣reference-definition 91s does␣not␣correspond␣to␣a␣structural␣element␣of␣a␣document.␣␣Instead,␣it 91s defines␣a␣label␣which␣can␣be␣used␣in␣reference␣links 91s and␣reference-style␣images␣elsewhere␣in␣the␣document.␣␣[Link 91s reference␣definitions]␣can␣come␣either␣before␣or␣after␣the␣links␣that␣use 91s them.
91s 91s Test #102 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m␣␣␣[foo]:␣ 91s ␣␣␣␣␣␣/url␣␣ 91s ␣␣␣␣␣␣␣␣␣␣␣'the␣title'␣␣ 91s 91s [foo] 91s [93m 91s === got ==================== 91s [0m 91s Test #103 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m[Foo*bar\]]:my_(url)␣'title␣(with␣parens)' 91s 91s [Foo*bar\]] 91s [93m 91s === got ==================== 91s [0m 91s Test #104 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m[Foo␣bar]: 91s91s 'title' 91s 91s [Foo␣bar] 91s [93m 91s === got ==================== 91s [0m 91s Test #105 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s The␣title␣may␣be␣omitted: 91s 91s [93m 91s === expected =============== 91s [0m[foo]: 91s /url 91s 91s [foo] 91s [93m 91s === got ==================== 91s [0m The␣title␣may␣be␣omitted:
91s 91s Test #106 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s The␣link␣destination␣may␣not␣be␣omitted: 91s 91s [93m 91s === expected =============== 91s [0m[foo]: 91s 91s [foo] 91s [93m 91s === got ==================== 91s [0mThe␣link␣destination␣may␣not␣be␣omitted:
91s 91s Test #107 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s A␣link␣can␣come␣before␣its␣corresponding␣definition: 91s 91s [93m 91s === expected =============== 91s [0m[foo] 91s 91s [foo]:␣url 91s [93m 91s === got ==================== 91s [0mA␣link␣can␣come␣before␣its␣corresponding␣definition:
91s 91s Test #108 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s If␣there␣are␣several␣matching␣definitions,␣the␣first␣one␣takes 91s precedence: 91s 91s [93m 91s === expected =============== 91s [0m[foo] 91s 91s [foo]:␣first 91s [foo]:␣second 91s [93m 91s === got ==================== 91s [0mIf␣there␣are␣several␣matching␣definitions,␣the␣first␣one␣takes 91s precedence:
91s 91s Test #109 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s As␣noted␣in␣the␣section␣on␣[Links],␣matching␣of␣labels␣is 91s case-insensitive␣(see␣[matches](#matches)). 91s 91s [93m 91s === expected =============== 91s [0m[FOO]:␣/url 91s 91s [Foo] 91s [93m 91s === got ==================== 91s [0mAs␣noted␣in␣the␣section␣on␣[Links],␣matching␣of␣labels␣is 91s case-insensitive␣(see␣matches).
91s 91s Test #110 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m[ΑΓΩ]:␣/φου 91s 91s [αγω] 91s [93m 91s === got ==================== 91s [0m 91s Test #111 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Here␣is␣a␣link␣reference␣definition␣with␣no␣corresponding␣link. 91s It␣contributes␣nothing␣to␣the␣document. 91s 91s [93m 91s === expected =============== 91s [0m[foo]:␣/url 91s [93m 91s === got ==================== 91s [0mHere␣is␣a␣link␣reference␣definition␣with␣no␣corresponding␣link. 91s It␣contributes␣nothing␣to␣the␣document.
91s 91s Test #112 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s This␣is␣not␣a␣link␣reference␣definition,␣because␣there␣are 91s non-space␣characters␣after␣the␣title: 91s 91s [93m 91s === expected =============== 91s [0m[foo]:␣/url␣"title"␣ok 91s [93m 91s === got ==================== 91s [0mThis␣is␣not␣a␣link␣reference␣definition,␣because␣there␣are 91s non-space␣characters␣after␣the␣title:
91s 91s Test #113 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s This␣is␣not␣a␣link␣reference␣definition,␣because␣it␣is␣indented 91s four␣spaces: 91s 91s [93m 91s === expected =============== 91s [0m␣␣␣␣[foo]:␣/url␣"title" 91s 91s [foo] 91s [93m 91s === got ==================== 91s [0mThis␣is␣not␣a␣link␣reference␣definition,␣because␣it␣is␣indented 91s four␣spaces:
91s 91s Test #114 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s This␣is␣not␣a␣link␣reference␣definition,␣because␣it␣occurs␣inside 91s a␣code␣block: 91s 91s [93m 91s === expected =============== 91s [0m``` 91s [foo]:␣/url 91s ``` 91s 91s [foo] 91s [93m 91s === got ==================== 91s [0mThis␣is␣not␣a␣link␣reference␣definition,␣because␣it␣occurs␣inside 91s a␣code␣block:
91s 91s Test #115 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s A␣[link␣reference␣definition](#link-reference-definition)␣cannot 91s interrupt␣a␣paragraph. 91s 91s [93m 91s === expected =============== 91s [0mFoo 91s [bar]:␣/baz 91s 91s [bar] 91s [93m 91s === got ==================== 91s [0mA␣link␣reference␣definition␣cannot 91s interrupt␣a␣paragraph.
91s 91s Test #116 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s However,␣it␣can␣directly␣follow␣other␣block␣elements,␣such␣as␣headers 91s and␣horizontal␣rules,␣and␣it␣need␣not␣be␣followed␣by␣a␣blank␣line. 91s 91s [93m 91s === expected =============== 91s [0m#␣[Foo] 91s [foo]:␣/url 91s >␣bar 91s [93m 91s === got ==================== 91s [0mHowever,␣it␣can␣directly␣follow␣other␣block␣elements,␣such␣as␣headers 91s and␣horizontal␣rules,␣and␣it␣need␣not␣be␣followed␣by␣a␣blank␣line.
91s 91s Test #117 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Several␣[link␣references](#link-reference)␣can␣occur␣one␣after␣another, 91s without␣intervening␣blank␣lines. 91s 91s [93m 91s === expected =============== 91s [0m[foo]:␣/foo-url␣"foo" 91s [bar]:␣/bar-url 91s ␣␣"bar" 91s [baz]:␣/baz-url 91s 91s [foo], 91s [bar], 91s [baz] 91s [93m 91s === got ==================== 91s [0mSeveral␣link␣references␣can␣occur␣one␣after␣another, 91s without␣intervening␣blank␣lines.
91s 91s Test #118 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [Link␣reference␣definitions](#link-reference-definition)␣can␣occur 91s inside␣block␣containers,␣like␣lists␣and␣block␣quotations.␣␣They 91s affect␣the␣entire␣document,␣not␣just␣the␣container␣in␣which␣they 91s are␣defined: 91s 91s [93m 91s === expected =============== 91s [0m[foo] 91s 91s >␣[foo]:␣/url 91s [93m 91s === got ==================== 91s [0mLink␣reference␣definitions␣can␣occur 91s inside␣block␣containers,␣like␣lists␣and␣block␣quotations.␣␣They 91s affect␣the␣entire␣document,␣not␣just␣the␣container␣in␣which␣they 91s are␣defined:
91s 91s Test #119 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s 91s ##␣Paragraphs 91s 91s A␣sequence␣of␣non-blank␣lines␣that␣cannot␣be␣interpreted␣as␣other 91s kinds␣of␣blocks␣forms␣a␣[paragraph](#paragraph). 91s The␣contents␣of␣the␣paragraph␣are␣the␣result␣of␣parsing␣the 91s paragraph's␣raw␣content␣as␣inlines.␣␣The␣paragraph's␣raw␣content 91s is␣formed␣by␣concatenating␣the␣lines␣and␣removing␣initial␣and␣final 91s spaces. 91s 91s A␣simple␣example␣with␣two␣paragraphs: 91s 91s [93m 91s === expected =============== 91s [0maaa 91s 91s bbb 91s [93m 91s === got ==================== 91s [0mParagraphs
91sA␣sequence␣of␣non-blank␣lines␣that␣cannot␣be␣interpreted␣as␣other 91s kinds␣of␣blocks␣forms␣a␣paragraph. 91s The␣contents␣of␣the␣paragraph␣are␣the␣result␣of␣parsing␣the 91s paragraph's␣raw␣content␣as␣inlines.␣␣The␣paragraph's␣raw␣content 91s is␣formed␣by␣concatenating␣the␣lines␣and␣removing␣initial␣and␣final 91s spaces.
91sA␣simple␣example␣with␣two␣paragraphs:
91s 91s Test #120 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Paragraphs␣can␣contain␣multiple␣lines,␣but␣no␣blank␣lines: 91s 91s [93m 91s === expected =============== 91s [0maaa 91s bbb 91s 91s ccc 91s ddd 91s [93m 91s === got ==================== 91s [0mParagraphs␣can␣contain␣multiple␣lines,␣but␣no␣blank␣lines:
91s 91s Test #121 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Multiple␣blank␣lines␣between␣paragraph␣have␣no␣effect: 91s 91s [93m 91s === expected =============== 91s [0maaa 91s 91s 91s bbb 91s [93m 91s === got ==================== 91s [0mMultiple␣blank␣lines␣between␣paragraph␣have␣no␣effect:
91s 91s Test #122 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Leading␣spaces␣are␣skipped: 91s 91s [93m 91s === expected =============== 91s [0m␣␣aaa 91s ␣bbb 91s [93m 91s === got ==================== 91s [0mLeading␣spaces␣are␣skipped:
91s 91s Test #123 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Lines␣after␣the␣first␣may␣be␣indented␣any␣amount,␣since␣indented 91s code␣blocks␣cannot␣interrupt␣paragraphs. 91s 91s [93m 91s === expected =============== 91s [0maaa 91s ␣␣␣␣␣␣␣␣␣␣␣␣␣bbb 91s ␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣ccc 91s [93m 91s === got ==================== 91s [0mLines␣after␣the␣first␣may␣be␣indented␣any␣amount,␣since␣indented 91s code␣blocks␣cannot␣interrupt␣paragraphs.
91s 91s Test #124 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s However,␣the␣first␣line␣may␣be␣indented␣at␣most␣three␣spaces, 91s or␣an␣indented␣code␣block␣will␣be␣triggered: 91s 91s [93m 91s === expected =============== 91s [0m␣␣␣aaa 91s bbb 91s [93m 91s === got ==================== 91s [0mHowever,␣the␣first␣line␣may␣be␣indented␣at␣most␣three␣spaces, 91s or␣an␣indented␣code␣block␣will␣be␣triggered:
91s 91s Test #125 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m␣␣␣␣aaa 91s bbb 91s [93m 91s === got ==================== 91s [0m 91s Test #126 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Final␣spaces␣are␣stripped␣before␣inline␣parsing,␣so␣a␣paragraph 91s that␣ends␣with␣two␣or␣more␣spaces␣will␣not␣end␣with␣a␣hard␣line 91s break: 91s 91s [93m 91s === expected =============== 91s [0maaa␣␣␣␣␣ 91s bbb␣␣␣␣␣ 91s [93m 91s === got ==================== 91s [0mFinal␣spaces␣are␣stripped␣before␣inline␣parsing,␣so␣a␣paragraph 91s that␣ends␣with␣two␣or␣more␣spaces␣will␣not␣end␣with␣a␣hard␣line 91s break:
91s 91s Test #127 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s ##␣Blank␣lines 91s 91s [Blank␣lines](#blank-line)␣between␣block-level␣elements␣are␣ignored, 91s except␣for␣the␣role␣they␣play␣in␣determining␣whether␣a␣[list](#list) 91s is␣[tight](#tight)␣or␣[loose](#loose). 91s 91s Blank␣lines␣at␣the␣beginning␣and␣end␣of␣the␣document␣are␣also␣ignored. 91s 91s [93m 91s === expected =============== 91s [0m␣␣ 91s 91s aaa 91s ␣␣ 91s 91s #␣aaa 91s 91s ␣␣ 91s [93m 91s === got ==================== 91s [0mBlank␣lines
91sBlank␣lines␣between␣block-level␣elements␣are␣ignored, 91s except␣for␣the␣role␣they␣play␣in␣determining␣whether␣a␣list 91s is␣tight␣or␣loose.
91sBlank␣lines␣at␣the␣beginning␣and␣end␣of␣the␣document␣are␣also␣ignored.
91s 91s Test #128 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s 91s #␣Container␣blocks 91s 91s A␣[container␣block](#container-block)␣is␣a␣block␣that␣has␣other 91s blocks␣as␣its␣contents.␣␣There␣are␣two␣basic␣kinds␣of␣container␣blocks: 91s [block␣quotes](#block-quote)␣and␣[list␣items](#list-item). 91s [Lists](#list)␣are␣meta-containers␣for␣[list␣items](#list-item). 91s 91s We␣define␣the␣syntax␣for␣container␣blocks␣recursively.␣␣The␣general 91s form␣of␣the␣definition␣is: 91s 91s >␣If␣X␣is␣a␣sequence␣of␣blocks,␣then␣the␣result␣of 91s >␣transforming␣X␣in␣such-and-such␣a␣way␣is␣a␣container␣of␣type␣Y 91s >␣with␣these␣blocks␣as␣its␣content. 91s 91s So,␣we␣explain␣what␣counts␣as␣a␣block␣quote␣or␣list␣item␣by␣explaining 91s how␣these␣can␣be␣*generated*␣from␣their␣contents.␣This␣should␣suffice 91s to␣define␣the␣syntax,␣although␣it␣does␣not␣give␣a␣recipe␣for␣*parsing* 91s these␣constructions.␣␣(A␣recipe␣is␣provided␣below␣in␣the␣section␣entitled 91s [A␣parsing␣strategy](#appendix-a-a-parsing-strategy).) 91s 91s ##␣Block␣quotes 91s 91s A␣[block␣quote␣marker](#block-quote-marker)␣ 91s consists␣of␣0-3␣spaces␣of␣initial␣indent,␣plus␣(a)␣the␣character␣`>`␣together 91s with␣a␣following␣space,␣or␣(b)␣a␣single␣character␣`>`␣not␣followed␣by␣a␣space. 91s 91s The␣following␣rules␣define␣[block␣quotes](#block-quote): 91s 91s 91s 1.␣␣**Basic␣case.**␣␣If␣a␣string␣of␣lines␣*Ls*␣constitute␣a␣sequence 91s ␣␣␣␣of␣blocks␣*Bs*,␣then␣the␣result␣of␣appending␣a␣[block␣quote 91s ␣␣␣␣marker](#block-quote-marker)␣to␣the␣beginning␣of␣each␣line␣in␣*Ls* 91s ␣␣␣␣is␣a␣[block␣quote](#block-quote)␣containing␣*Bs*. 91s 91s 2.␣␣**Laziness.**␣␣If␣a␣string␣of␣lines␣*Ls*␣constitute␣a␣[block 91s ␣␣␣␣quote](#block-quote)␣with␣contents␣*Bs*,␣then␣the␣result␣of␣deleting 91s ␣␣␣␣the␣initial␣[block␣quote␣marker](#block-quote-marker)␣from␣one␣or 91s ␣␣␣␣more␣lines␣in␣which␣the␣next␣non-space␣character␣after␣the␣[block 91s ␣␣␣␣quote␣marker](#block-quote-marker)␣is␣[paragraph␣continuation 91s ␣␣␣␣text](#paragraph-continuation-text)␣is␣a␣block␣quote␣with␣*Bs*␣as 91s ␣␣␣␣its␣content.␣␣ 91s ␣␣␣␣[Paragraph␣continuation␣text](#paragraph-continuation-text)␣is␣text 91s ␣␣␣␣that␣will␣be␣parsed␣as␣part␣of␣the␣content␣of␣a␣paragraph,␣but␣does 91s ␣␣␣␣not␣occur␣at␣the␣beginning␣of␣the␣paragraph. 91s 91s 3.␣␣**Consecutiveness.**␣␣A␣document␣cannot␣contain␣two␣[block 91s ␣␣␣␣quotes](#block-quote)␣in␣a␣row␣unless␣there␣is␣a␣[blank 91s ␣␣␣␣line](#blank-line)␣between␣them. 91s 91s Nothing␣else␣counts␣as␣a␣[block␣quote](#block-quote). 91s 91s Here␣is␣a␣simple␣example: 91s 91s [93m 91s === expected =============== 91s [0m>␣#␣Foo 91s >␣bar 91s >␣baz 91s [93m 91s === got ==================== 91s [0mContainer␣blocks
91sA␣container␣block␣is␣a␣block␣that␣has␣other 91s blocks␣as␣its␣contents.␣␣There␣are␣two␣basic␣kinds␣of␣container␣blocks: 91s block␣quotes␣and␣list␣items. 91s Lists␣are␣meta-containers␣for␣list␣items.
91sWe␣define␣the␣syntax␣for␣container␣blocks␣recursively.␣␣The␣general 91s form␣of␣the␣definition␣is:
91s91s91sIf␣X␣is␣a␣sequence␣of␣blocks,␣then␣the␣result␣of 91s transforming␣X␣in␣such-and-such␣a␣way␣is␣a␣container␣of␣type␣Y 91s with␣these␣blocks␣as␣its␣content.
91sSo,␣we␣explain␣what␣counts␣as␣a␣block␣quote␣or␣list␣item␣by␣explaining 91s how␣these␣can␣be␣generated␣from␣their␣contents.␣This␣should␣suffice 91s to␣define␣the␣syntax,␣although␣it␣does␣not␣give␣a␣recipe␣for␣parsing 91s these␣constructions.␣␣(A␣recipe␣is␣provided␣below␣in␣the␣section␣entitled 91s A␣parsing␣strategy.)
91sBlock␣quotes
91sA␣block␣quote␣marker␣ 91s consists␣of␣0-3␣spaces␣of␣initial␣indent,␣plus␣(a)␣the␣character␣
91s>␣together 91s with␣a␣following␣space,␣or␣(b)␣a␣single␣character␣>␣not␣followed␣by␣a␣space.The␣following␣rules␣define␣block␣quotes: 91s
91s91s
91s- 91s
Basic␣case.␣␣If␣a␣string␣of␣lines␣Ls␣constitute␣a␣sequence 91s of␣blocks␣Bs,␣then␣the␣result␣of␣appending␣a␣block␣quote 91s marker␣to␣the␣beginning␣of␣each␣line␣in␣Ls 91s is␣a␣block␣quote␣containing␣Bs.
- 91s
Laziness.␣␣If␣a␣string␣of␣lines␣Ls␣constitute␣a␣block 91s quote␣with␣contents␣Bs,␣then␣the␣result␣of␣deleting 91s the␣initial␣block␣quote␣marker␣from␣one␣or 91s more␣lines␣in␣which␣the␣next␣non-space␣character␣after␣the␣block 91s quote␣marker␣is␣paragraph␣continuation 91s text␣is␣a␣block␣quote␣with␣Bs␣as 91s its␣content.␣␣ 91s Paragraph␣continuation␣text␣is␣text 91s that␣will␣be␣parsed␣as␣part␣of␣the␣content␣of␣a␣paragraph,␣but␣does 91s not␣occur␣at␣the␣beginning␣of␣the␣paragraph.
- 91s
Consecutiveness.␣␣A␣document␣cannot␣contain␣two␣block 91s quotes␣in␣a␣row␣unless␣there␣is␣a␣blank 91s line␣between␣them.
Nothing␣else␣counts␣as␣a␣block␣quote.
91sHere␣is␣a␣simple␣example:
91s 91s Test #129 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s The␣spaces␣after␣the␣`>`␣characters␣can␣be␣omitted: 91s 91s [93m 91s === expected =============== 91s [0m>#␣Foo 91s >bar 91s >␣baz 91s [93m 91s === got ==================== 91s [0mThe␣spaces␣after␣the␣
91s 91s Test #130 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s The␣`>`␣characters␣can␣be␣indented␣1-3␣spaces: 91s 91s [93m 91s === expected =============== 91s [0m␣␣␣>␣#␣Foo 91s ␣␣␣>␣bar 91s ␣>␣baz 91s [93m 91s === got ==================== 91s [0m>␣characters␣can␣be␣omitted:The␣
91s 91s Test #131 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Four␣spaces␣gives␣us␣a␣code␣block: 91s 91s [93m 91s === expected =============== 91s [0m␣␣␣␣>␣#␣Foo 91s ␣␣␣␣>␣bar 91s ␣␣␣␣>␣baz 91s [93m 91s === got ==================== 91s [0m>␣characters␣can␣be␣indented␣1-3␣spaces:Four␣spaces␣gives␣us␣a␣code␣block:
91s 91s Test #132 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s The␣Laziness␣clause␣allows␣us␣to␣omit␣the␣`>`␣before␣a 91s paragraph␣continuation␣line: 91s 91s [93m 91s === expected =============== 91s [0m>␣#␣Foo 91s >␣bar 91s baz 91s [93m 91s === got ==================== 91s [0mThe␣Laziness␣clause␣allows␣us␣to␣omit␣the␣
91s 91s Test #133 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s A␣block␣quote␣can␣contain␣some␣lazy␣and␣some␣non-lazy 91s continuation␣lines: 91s 91s [93m 91s === expected =============== 91s [0m>␣bar 91s baz 91s >␣foo 91s [93m 91s === got ==================== 91s [0m>␣before␣a 91s paragraph␣continuation␣line:A␣block␣quote␣can␣contain␣some␣lazy␣and␣some␣non-lazy 91s continuation␣lines:
91s 91s Test #134 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s Laziness␣only␣applies␣to␣lines␣that␣are␣continuations␣of 91s paragraphs.␣Lines␣containing␣characters␣or␣indentation␣that␣indicate 91s block␣structure␣cannot␣be␣lazy. 91s 91s [93m 91s === expected =============== 91s [0m>␣foo 91s --- 91s [93m 91s === got ==================== 91s [0mLaziness␣only␣applies␣to␣lines␣that␣are␣continuations␣of 91s paragraphs.␣Lines␣containing␣characters␣or␣indentation␣that␣indicate 91s block␣structure␣cannot␣be␣lazy.
91s 91s Test #135 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m>␣-␣foo 91s -␣bar 91s [93m 91s === got ==================== 91s [0m 91s Test #136 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m>␣␣␣␣␣foo 91s ␣␣␣␣bar 91s [93m 91s === got ==================== 91s [0m 91s Test #137 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s [93m 91s === expected =============== 91s [0m>␣``` 91s foo 91s ``` 91s [93m 91s === got ==================== 91s [0m 91s Test #138 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m 91s A␣block␣quote␣can␣be␣empty: 91s 91s [93m 91s === expected =============== 91s [0m[93m 91s === got ==================== 91s [0mA␣block␣quote␣can␣be␣empty:
91s 91s Test #139 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m91s91s 91s Test #140 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s [93m 91s === expected =============== 91s [0m 91s A␣block␣quote␣can␣have␣initial␣or␣final␣blank␣lines: 91s 91s [93m 91s === got ==================== 91s [0m91s91s 91s Test #141 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s [93m 91s === expected =============== 91s [0m 91s A␣blank␣line␣always␣separates␣block␣quotes: 91s 91s [93m 91s === got ==================== 91s [0mfoo
91s91s91s 91s Test #142 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mfoo
91s91s91sfoo
91s91s91s [93m 91s === expected =============== 91s [0m 91s (Most␣current␣Markdown␣implementations,␣including␣John␣Gruber's 91s original␣`Markdown.pl`,␣will␣parse␣this␣example␣as␣a␣single␣block␣quote 91s with␣two␣paragraphs.␣␣But␣it␣seems␣better␣to␣allow␣the␣author␣to␣decide 91s whether␣two␣block␣quotes␣or␣one␣are␣wanted.) 91s 91s Consecutiveness␣means␣that␣if␣we␣put␣these␣block␣quotes␣together, 91s we␣get␣a␣single␣block␣quote: 91s 91s [93m 91s === got ==================== 91s [0mbar
91s91s91sfoo
91s91s91s 91s Test #143 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mbar
91s91s91s [93m 91s === expected =============== 91s [0m 91s To␣get␣a␣block␣quote␣with␣two␣paragraphs,␣use: 91s 91s [93m 91s === got ==================== 91s [0mfoo 91s bar
91s91s91s 91s Test #144 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mfoo 91s bar
91s91s91s [93m 91s === expected =============== 91s [0m 91s Block␣quotes␣can␣interrupt␣paragraphs: 91s 91s [93m 91s === got ==================== 91s [0mfoo
91sbar
91s91s91s 91s Test #145 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mfoo
91sbar
91sfoo
91s91s91s [93m 91s === expected =============== 91s [0m 91s In␣general,␣blank␣lines␣are␣not␣needed␣before␣or␣after␣block 91s quotes: 91s 91s [93m 91s === got ==================== 91s [0mbar
91sfoo
91s91s91s 91s Test #146 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mbar
91s91s91saaa
91s
91s91s91s [93m 91s === expected =============== 91s [0m 91s However,␣because␣of␣laziness,␣a␣blank␣line␣is␣needed␣between 91s a␣block␣quote␣and␣a␣following␣paragraph: 91s 91s [93m 91s === got ==================== 91s [0mbbb
91s91s91saaa
91s
91s91s91s 91s Test #147 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mbbb
91s91s91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0mbar 91s baz
91s91s91s 91s Test #148 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mbar 91s baz
91s91s91sbar
91sbaz
91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m91s91sbar
91sbaz
91s 91s Test #149 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91sbar
91sbaz
91s [93m 91s === expected =============== 91s [0m 91s It␣is␣a␣consequence␣of␣the␣Laziness␣rule␣that␣any␣number 91s of␣initial␣`>`s␣may␣be␣omitted␣on␣a␣continuation␣line␣of␣a 91s nested␣block␣quote: 91s 91s [93m 91s === got ==================== 91s [0m91s91sbar
91sbaz
91s 91s Test #150 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m91s91s91s91sfoo 91s bar
91s91s91s 91s Test #151 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s91s91sfoo 91s bar
91s91s91s [93m 91s === expected =============== 91s [0m 91s When␣including␣an␣indented␣code␣block␣in␣a␣block␣quote, 91s remember␣that␣the␣[block␣quote␣marker](#block-quote-marker)␣includes 91s both␣the␣`>`␣and␣a␣following␣space.␣␣So␣*five␣spaces*␣are␣needed␣after 91s the␣`>`: 91s 91s [93m 91s === got ==================== 91s [0m91s91s91s91sfoo 91s bar 91s baz
91s91s91s 91s Test #152 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s91s91sfoo 91s bar 91s baz
91s91s91s91scode 91s91s91s [93m 91s === expected =============== 91s [0m 91s 91s ##␣List␣items 91s 91s A␣[list␣marker](#list-marker)␣␣is␣a 91s [bullet␣list␣marker](#bullet-list-marker)␣or␣an␣[ordered␣list 91s marker](#ordered-list-marker). 91s 91s A␣[bullet␣list␣marker](#bullet-list-marker)␣ 91s is␣a␣`-`,␣`+`,␣or␣`*`␣character. 91s 91s An␣[ordered␣list␣marker](#ordered-list-marker)␣ 91s is␣a␣sequence␣of␣one␣of␣more␣digits␣(`0-9`),␣followed␣by␣either␣a 91s `.`␣character␣or␣a␣`)`␣character. 91s 91s The␣following␣rules␣define␣[list␣items](#list-item): 91s 91s 1.␣␣**Basic␣case.**␣␣If␣a␣sequence␣of␣lines␣*Ls*␣constitute␣a␣sequence␣of 91s ␣␣␣␣blocks␣*Bs*␣starting␣with␣a␣non-space␣character␣and␣not␣separated 91s ␣␣␣␣from␣each␣other␣by␣more␣than␣one␣blank␣line,␣and␣*M*␣is␣a␣list 91s ␣␣␣␣marker␣*M*␣of␣width␣*W*␣followed␣by␣0␣<␣*N*␣<␣5␣spaces,␣then␣the␣result 91s ␣␣␣␣of␣prepending␣*M*␣and␣the␣following␣spaces␣to␣the␣first␣line␣of 91s ␣␣␣␣*Ls*,␣and␣indenting␣subsequent␣lines␣of␣*Ls*␣by␣*W␣+␣N*␣spaces,␣is␣a 91s ␣␣␣␣list␣item␣with␣*Bs*␣as␣its␣contents.␣␣The␣type␣of␣the␣list␣item 91s ␣␣␣␣(bullet␣or␣ordered)␣is␣determined␣by␣the␣type␣of␣its␣list␣marker. 91s ␣␣␣␣If␣the␣list␣item␣is␣ordered,␣then␣it␣is␣also␣assigned␣a␣start 91s ␣␣␣␣number,␣based␣on␣the␣ordered␣list␣marker. 91s 91s For␣example,␣let␣*Ls*␣be␣the␣lines 91s 91s [93m 91s === got ==================== 91s [0mnot␣code
91s91s91s91scode 91s91s91s 91s Test #153 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mnot␣code
91sA␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91s91s [93m 91s === expected =============== 91s [0m 91s And␣let␣*M*␣be␣the␣marker␣`1.`,␣and␣*N*␣=␣2.␣␣Then␣rule␣#1␣says 91s that␣the␣following␣is␣an␣ordered␣list␣item␣with␣start␣number␣1, 91s and␣the␣same␣contents␣as␣*Ls*: 91s 91s [93m 91s === got ==================== 91s [0mA␣block␣quote.
91sA␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91s91s 91s Test #154 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mA␣block␣quote.
91s91s
91s [93m 91s === expected =============== 91s [0m 91s The␣most␣important␣thing␣to␣notice␣is␣that␣the␣position␣of 91s the␣text␣after␣the␣list␣marker␣determines␣how␣much␣indentation 91s is␣needed␣in␣subsequent␣blocks␣in␣the␣list␣item.␣␣If␣the␣list 91s marker␣takes␣up␣two␣spaces,␣and␣there␣are␣three␣spaces␣between 91s the␣list␣marker␣and␣the␣next␣nonspace␣character,␣then␣blocks 91s must␣be␣indented␣five␣spaces␣in␣order␣to␣fall␣under␣the␣list 91s item. 91s 91s Here␣are␣some␣examples␣showing␣how␣far␣content␣must␣be␣indented␣to␣be 91s put␣under␣the␣list␣item: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s 91s Test #155 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s- one
91stwo
91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m91s
91s- one
91stwo
91s 91s Test #156 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s
91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m- 91s
one
91stwo
91s
91s 91s Test #157 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
one
91stwo
91s
91s- one
91s91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m␣two 91s91s
91s- one
91s91s 91s Test #158 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m␣two 91s91s
91s [93m 91s === expected =============== 91s [0m 91s It␣is␣tempting␣to␣think␣of␣this␣in␣terms␣of␣columns:␣␣the␣continuation 91s blocks␣must␣be␣indented␣at␣least␣to␣the␣column␣of␣the␣first␣nonspace 91s character␣after␣the␣list␣marker.␣␣However,␣that␣is␣not␣quite␣right. 91s The␣spaces␣after␣the␣list␣marker␣determine␣how␣much␣relative␣indentation 91s is␣needed.␣␣Which␣column␣this␣indentation␣reaches␣will␣depend␣on 91s how␣the␣list␣item␣is␣embedded␣in␣other␣constructions,␣as␣shown␣by 91s this␣example: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
one
91stwo
91s
91s 91s Test #159 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
one
91stwo
91s91s [93m 91s === expected =============== 91s [0m 91s Here␣`two`␣occurs␣in␣the␣same␣column␣as␣the␣list␣marker␣`1.`, 91s but␣is␣actually␣contained␣in␣the␣list␣item,␣because␣there␣is 91s sufficent␣indentation␣after␣the␣last␣containing␣blockquote␣marker. 91s 91s The␣converse␣is␣also␣possible.␣␣In␣the␣following␣example,␣the␣word␣`two` 91s occurs␣far␣to␣the␣right␣of␣the␣initial␣text␣of␣the␣list␣item,␣`one`,␣but 91s it␣is␣not␣considered␣part␣of␣the␣list␣item,␣because␣it␣is␣not␣indented 91s far␣enough␣past␣the␣blockquote␣marker: 91s 91s [93m 91s === got ==================== 91s [0m91s91s91s
91s- 91s
one
91stwo
91s91s 91s Test #160 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s91s
91s- 91s
one
91stwo
91s91s [93m 91s === expected =============== 91s [0m 91s A␣list␣item␣may␣not␣contain␣blocks␣that␣are␣separated␣by␣more␣than 91s one␣blank␣line.␣␣Thus,␣two␣blank␣lines␣will␣end␣a␣list,␣unless␣the 91s two␣blanks␣are␣contained␣in␣a␣[fenced␣code␣block](#fenced-code-block). 91s 91s [93m 91s === got ==================== 91s [0m91s91s91s
91s- one
91stwo
91s91s91s 91s Test #161 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s91s91s
91s- one
91stwo
91s91s
91s- 91s
foo
91sbar
- 91s
foo
bar
91s91s
91s [93m 91s === expected =============== 91s [0m 91s A␣list␣item␣may␣contain␣any␣kind␣of␣block: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
foo 91s 91s 91s bar 91s91s
91s- 91s
foo
91sbar
- 91s
foo
bar
91s91s
91s 91s Test #162 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
foo 91sbar 91s
91s
91s [93m 91s === expected =============== 91s [0m 91s 2.␣␣**Item␣starting␣with␣indented␣code.**␣␣If␣a␣sequence␣of␣lines␣*Ls* 91s ␣␣␣␣constitute␣a␣sequence␣of␣blocks␣*Bs*␣starting␣with␣an␣indented␣code 91s ␣␣␣␣block␣and␣not␣separated␣from␣each␣other␣by␣more␣than␣one␣blank␣line, 91s ␣␣␣␣and␣*M*␣is␣a␣list␣marker␣*M*␣of␣width␣*W*␣followed␣by 91s ␣␣␣␣one␣space,␣then␣the␣result␣of␣prepending␣*M*␣and␣the␣following 91s ␣␣␣␣space␣to␣the␣first␣line␣of␣*Ls*,␣and␣indenting␣subsequent␣lines␣of 91s ␣␣␣␣*Ls*␣by␣*W␣+␣1*␣spaces,␣is␣a␣list␣item␣with␣*Bs*␣as␣its␣contents. 91s ␣␣␣␣If␣a␣line␣is␣empty,␣then␣it␣need␣not␣be␣indented.␣␣The␣type␣of␣the 91s ␣␣␣␣list␣item␣(bullet␣or␣ordered)␣is␣determined␣by␣the␣type␣of␣its␣list 91s ␣␣␣␣marker.␣␣If␣the␣list␣item␣is␣ordered,␣then␣it␣is␣also␣assigned␣a 91s ␣␣␣␣start␣number,␣based␣on␣the␣ordered␣list␣marker. 91s 91s An␣indented␣code␣block␣will␣have␣to␣be␣indented␣four␣spaces␣beyond 91s the␣edge␣of␣the␣region␣where␣text␣will␣be␣included␣in␣the␣list␣item. 91s In␣the␣following␣case␣that␣is␣6␣spaces: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
foo
91s91sbar 91sbaz
91s91sbam
91s91s
91s 91s Test #163 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
foo
91s91sbar 91sbaz
91s91sbam
91s91s
91s [93m 91s === expected =============== 91s [0m 91s And␣in␣this␣case␣it␣is␣11␣spaces: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
foo
91sbar 91s91s
91s 91s Test #164 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
foo
91sbar 91s91s
91s [93m 91s === expected =============== 91s [0m 91s If␣the␣*first*␣block␣in␣the␣list␣item␣is␣an␣indented␣code␣block, 91s then␣by␣rule␣#2,␣the␣contents␣must␣be␣indented␣*one*␣space␣after␣the 91s list␣marker: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
foo
91sbar 91s91s
91s 91s Test #165 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
foo
91sbar 91s91sindented␣code 91sparagraph
91s91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0mmore␣code 91s91sindented␣code 91sparagraph
91s91s 91s Test #166 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0mmore␣code 91s91s
91s [93m 91s === expected =============== 91s [0m 91s Note␣that␣an␣additional␣space␣indent␣is␣interpreted␣as␣space 91s inside␣the␣code␣block: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
91sindented␣code 91sparagraph
91smore␣code 91s91s
91s 91s Test #167 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
91sindented␣code 91sparagraph
91smore␣code 91s91s
91s [93m 91s === expected =============== 91s [0m 91s Note␣that␣rules␣#1␣and␣#2␣only␣apply␣to␣two␣cases:␣␣(a)␣cases 91s in␣which␣the␣lines␣to␣be␣included␣in␣a␣list␣item␣begin␣with␣a␣nonspace 91s character,␣and␣(b)␣cases␣in␣which␣they␣begin␣with␣an␣indented␣code 91s block.␣␣In␣a␣case␣like␣the␣following,␣where␣the␣first␣block␣begins␣with 91s a␣three-space␣indent,␣the␣rules␣do␣not␣allow␣us␣to␣form␣a␣list␣item␣by 91s indenting␣the␣whole␣thing␣and␣prepending␣a␣list␣marker: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
91s␣indented␣code 91sparagraph
91smore␣code 91s91s
91s 91s Test #168 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
91s␣indented␣code 91sparagraph
91smore␣code 91sfoo
91sbar
91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0mfoo
91sbar
91s 91s Test #169 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s
91s- foo
91sbar
91s [93m 91s === expected =============== 91s [0m 91s This␣is␣not␣a␣significant␣restriction,␣because␣when␣a␣block␣begins 91s with␣1-3␣spaces␣indent,␣the␣indentation␣can␣always␣be␣removed␣without 91s a␣change␣in␣interpretation,␣allowing␣rule␣#1␣to␣be␣applied.␣␣So,␣in 91s the␣above␣case: 91s 91s [93m 91s === got ==================== 91s [0m91s
91s- foo
91sbar
91s 91s Test #170 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s
91s [93m 91s === expected =============== 91s [0m 91s 91s 3.␣␣**Indentation.**␣␣If␣a␣sequence␣of␣lines␣*Ls*␣constitutes␣a␣list␣item 91s ␣␣␣␣according␣to␣rule␣#1␣or␣#2,␣then␣the␣result␣of␣indenting␣each␣line 91s ␣␣␣␣of␣*L*␣by␣1-3␣spaces␣(the␣same␣for␣each␣line)␣also␣constitutes␣a 91s ␣␣␣␣list␣item␣with␣the␣same␣contents␣and␣attributes.␣␣If␣a␣line␣is 91s ␣␣␣␣empty,␣then␣it␣need␣not␣be␣indented. 91s 91s Indented␣one␣space: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
foo
91sbar
91s
91s 91s Test #171 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
foo
91sbar
91s
91s [93m 91s === expected =============== 91s [0m 91s Indented␣two␣spaces: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s 91s Test #172 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s [93m 91s === expected =============== 91s [0m 91s Indented␣three␣spaces: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s 91s Test #173 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s [93m 91s === expected =============== 91s [0m 91s Four␣spaces␣indent␣gives␣a␣code␣block: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s 91s Test #174 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s [93m 91s === expected =============== 91s [0m 91s 91s 4.␣␣**Laziness.**␣␣If␣a␣string␣of␣lines␣*Ls*␣constitute␣a␣[list 91s ␣␣␣␣item](#list-item)␣with␣contents␣*Bs*,␣then␣the␣result␣of␣deleting 91s ␣␣␣␣some␣or␣all␣of␣the␣indentation␣from␣one␣or␣more␣lines␣in␣which␣the 91s ␣␣␣␣next␣non-space␣character␣after␣the␣indentation␣is 91s ␣␣␣␣[paragraph␣continuation␣text](#paragraph-continuation-text)␣is␣a 91s ␣␣␣␣list␣item␣with␣the␣same␣contents␣and␣attributes. 91s 91s Here␣is␣an␣example␣with␣lazy␣continuation␣lines: 91s 91s [93m 91s === got ==================== 91s [0m1.␣␣A␣paragraph 91s ␣␣␣␣with␣two␣lines. 91s 91s ␣␣␣␣␣␣␣␣indented␣code 91s 91s ␣␣␣␣>␣A␣block␣quote. 91s91s 91s Test #175 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m1.␣␣A␣paragraph 91s ␣␣␣␣with␣two␣lines. 91s91s␣␣␣␣indented␣code 91s 91s >␣A␣block␣quote. 91s91s
91s [93m 91s === expected =============== 91s [0m 91s Indentation␣can␣be␣partially␣deleted: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s 91s Test #176 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
A␣paragraph 91s with␣two␣lines.
91s91sindented␣code 91s91sA␣block␣quote.
91s91s
91s [93m 91s === expected =============== 91s [0m 91s These␣examples␣show␣how␣laziness␣can␣work␣in␣nested␣structures: 91s 91s [93m 91s === got ==================== 91s [0m- A␣paragraph 91s with␣two␣lines.
91s91s
91s 91s Test #177 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- A␣paragraph 91s with␣two␣lines.
91s91s91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m91s
91s- 91s
91sBlockquote 91s continued␣here.
91s91s91s 91s Test #178 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s
91s- 91s
91sBlockquote 91s continued␣here.
91s91s91s [93m 91s === expected =============== 91s [0m 91s 91s 5.␣␣**That's␣all.**␣Nothing␣that␣is␣not␣counted␣as␣a␣list␣item␣by␣rules 91s ␣␣␣␣#1--4␣counts␣as␣a␣[list␣item](#list-item). 91s 91s The␣rules␣for␣sublists␣follow␣from␣the␣general␣rules␣above.␣␣A␣sublist 91s must␣be␣indented␣the␣same␣number␣of␣spaces␣a␣paragraph␣would␣need␣to␣be 91s in␣order␣to␣be␣included␣in␣the␣list␣item. 91s 91s So,␣in␣this␣case␣we␣need␣two␣spaces␣indent: 91s 91s [93m 91s === got ==================== 91s [0m91s
91s- 91s
91sBlockquote 91s continued␣here.
91s91s91s 91s Test #179 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m91s
91s- 91s
91sBlockquote 91s continued␣here.
91s91s
91s [93m 91s === expected =============== 91s [0m 91s One␣is␣not␣enough: 91s 91s [93m 91s === got ==================== 91s [0m- foo 91s
91s91s
- bar 91s
91s91s
- baz
91s91s
91s 91s Test #180 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- foo 91s
91s91s
- bar 91s
91s91s
- baz
91s91s
91s [93m 91s === expected =============== 91s [0m 91s Here␣we␣need␣four,␣because␣the␣list␣marker␣is␣wider: 91s 91s [93m 91s === got ==================== 91s [0m- foo
91s- bar
91s- baz
91s91s
91s 91s Test #181 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- foo
91s- bar
91s- baz
91s91s
91s [93m 91s === expected =============== 91s [0m 91s Three␣is␣not␣enough: 91s 91s [93m 91s === got ==================== 91s [0m- foo 91s
91s91s
- bar
91s91s
91s 91s Test #182 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- foo 91s
91s91s
- bar
91s91s
91s- foo
91s91s
91s [93m 91s === expected =============== 91s [0m 91s A␣list␣may␣be␣the␣first␣block␣in␣a␣list␣item: 91s 91s [93m 91s === got ==================== 91s [0m- bar
91s91s
91s- foo
91s91s
91s 91s Test #183 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- bar
91s91s
91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m- 91s
91s
- foo
91s91s
91s 91s Test #184 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
91s
- foo
91s91s
91s [93m 91s === expected =============== 91s [0m 91s A␣list␣item␣may␣be␣empty: 91s 91s [93m 91s === got ==================== 91s [0m- 91s
91s
- 91s
91s
- foo
91s91s
91s 91s Test #185 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- 91s
91s
- 91s
91s
- foo
91s91s
91s [93m 91s === expected =============== 91s [0m 91s [93m 91s === got ==================== 91s [0m- foo
91s 91s- bar
91s91s
91s 91s Test #186 91s [91mcross[0m 91s [93m=== markdown =============== 91s [0m- foo
91s 91s- bar
91s91s 91s
91s [93m 91s === expected =============== 91s [0m 91s ###␣Motivation 91s 91s John␣Gruber's␣Markdown␣spec␣says␣the␣following␣about␣list␣items: 91s 91s 1.␣"List␣markers␣typically␣start␣at␣the␣left␣margin,␣but␣may␣be␣indented 91s ␣␣␣by␣up␣to␣three␣spaces.␣List␣markers␣must␣be␣followed␣by␣one␣or␣more 91s ␣␣␣spaces␣or␣a␣tab." 91s 91s 2.␣"To␣make␣lists␣look␣nice,␣you␣can␣wrap␣items␣with␣hanging␣indents.... 91s ␣␣␣But␣if␣you␣don't␣want␣to,␣you␣don't␣have␣to." 91s 91s 3.␣"List␣items␣may␣consist␣of␣multiple␣paragraphs.␣Each␣subsequent 91s ␣␣␣paragraph␣in␣a␣list␣item␣must␣be␣indented␣by␣either␣4␣spaces␣or␣one 91s ␣␣␣tab." 91s 91s 4.␣"It␣looks␣nice␣if␣you␣indent␣every␣line␣of␣the␣subsequent␣paragraphs, 91s ␣␣␣but␣here␣again,␣Markdown␣will␣allow␣you␣to␣be␣lazy." 91s 91s 5.␣"To␣put␣a␣blockquote␣within␣a␣list␣item,␣the␣blockquote's␣`>` 91s ␣␣␣delimiters␣need␣to␣be␣indented." 91s 91s 6.␣"To␣put␣a␣code␣block␣within␣a␣list␣item,␣the␣code␣block␣needs␣to␣be 91s ␣␣␣indented␣twice␣—␣8␣spaces␣or␣two␣tabs." 91s 91s These␣rules␣specify␣that␣a␣paragraph␣under␣a␣list␣item␣must␣be␣indented 91s four␣spaces␣(presumably,␣from␣the␣left␣margin,␣rather␣than␣the␣start␣of 91s the␣list␣marker,␣but␣this␣is␣not␣said),␣and␣that␣code␣under␣a␣list␣item 91s must␣be␣indented␣eight␣spaces␣instead␣of␣the␣usual␣four.␣␣They␣also␣say 91s that␣a␣block␣quote␣must␣be␣indented,␣but␣not␣by␣how␣much;␣however,␣the 91s example␣given␣has␣four␣spaces␣indentation.␣␣Although␣nothing␣is␣said 91s about␣other␣kinds␣of␣block-level␣content,␣it␣is␣certainly␣reasonable␣to 91s infer␣that␣*all*␣block␣elements␣under␣a␣list␣item,␣including␣other 91s lists,␣must␣be␣indented␣four␣spaces.␣␣This␣principle␣has␣been␣called␣the 91s *four-space␣rule*. 91s 91s The␣four-space␣rule␣is␣clear␣and␣principled,␣and␣if␣the␣reference 91s implementation␣`Markdown.pl`␣had␣followed␣it,␣it␣probably␣would␣have 91s become␣the␣standard.␣␣However,␣`Markdown.pl`␣allowed␣paragraphs␣and 91s sublists␣to␣start␣with␣only␣two␣spaces␣indentation,␣at␣least␣on␣the 91s outer␣level.␣␣Worse,␣its␣behavior␣was␣inconsistent:␣a␣sublist␣of␣an 91s outer-level␣list␣needed␣two␣spaces␣indentation,␣but␣a␣sublist␣of␣this 91s sublist␣needed␣three␣spaces.␣␣It␣is␣not␣surprising,␣then,␣that␣different 91s implementations␣of␣Markdown␣have␣developed␣very␣different␣rules␣for 91s determining␣what␣comes␣under␣a␣list␣item.␣␣(Pandoc␣and␣python-Markdown, 91s for␣example,␣stuck␣with␣Gruber's␣syntax␣description␣and␣the␣four-space 91s rule,␣while␣discount,␣redcarpet,␣marked,␣PHP␣Markdown,␣and␣others 91s followed␣`Markdown.pl`'s␣behavior␣more␣closely.) 91s 91s Unfortunately,␣given␣the␣divergences␣between␣implementations,␣there 91s is␣no␣way␣to␣give␣a␣spec␣for␣list␣items␣that␣will␣be␣guaranteed␣not 91s to␣break␣any␣existing␣documents.␣␣However,␣the␣spec␣given␣here␣should 91s correctly␣handle␣lists␣formatted␣with␣either␣the␣four-space␣rule␣or 91s the␣more␣forgiving␣`Markdown.pl`␣behavior,␣provided␣they␣are␣laid␣out 91s in␣a␣way␣that␣is␣natural␣for␣a␣human␣to␣read. 91s 91s The␣strategy␣here␣is␣to␣let␣the␣width␣and␣indentation␣of␣the␣list␣marker 91s determine␣the␣indentation␣necessary␣for␣blocks␣to␣fall␣under␣the␣list 91s item,␣rather␣than␣having␣a␣fixed␣and␣arbitrary␣number.␣␣The␣writer␣can 91s think␣of␣the␣body␣of␣the␣list␣item␣as␣a␣unit␣which␣gets␣indented␣to␣the 91s right␣enough␣to␣fit␣the␣list␣marker␣(and␣any␣indentation␣on␣the␣list 91s marker).␣␣(The␣laziness␣rule,␣#4,␣then␣allows␣continuation␣lines␣to␣be 91s unindented␣if␣needed.) 91s 91s This␣rule␣is␣superior,␣we␣claim,␣to␣any␣rule␣requiring␣a␣fixed␣level␣of 91s indentation␣from␣the␣margin.␣␣The␣four-space␣rule␣is␣clear␣but 91s unnatural.␣It␣is␣quite␣unintuitive␣that 91s 91s ```␣markdown 91s -␣foo 91s 91s ␣␣bar 91s 91s ␣␣-␣baz 91s ``` 91s 91s should␣be␣parsed␣as␣two␣lists␣with␣an␣intervening␣paragraph, 91s 91s ```␣html 91s91s
91s- foo
91sbar
91s91s
91s ``` 91s 91s as␣the␣four-space␣rule␣demands,␣rather␣than␣a␣single␣list, 91s 91s ```␣html 91s- baz
91s91s
91s ``` 91s 91s The␣choice␣of␣four␣spaces␣is␣arbitrary.␣␣It␣can␣be␣learned,␣but␣it␣is 91s not␣likely␣to␣be␣guessed,␣and␣it␣trips␣up␣beginners␣regularly. 91s 91s Would␣it␣help␣to␣adopt␣a␣two-space␣rule?␣␣The␣problem␣is␣that␣such 91s a␣rule,␣together␣with␣the␣rule␣allowing␣1--3␣spaces␣indentation␣of␣the 91s initial␣list␣marker,␣allows␣text␣that␣is␣indented␣*less␣than*␣the 91s original␣list␣marker␣to␣be␣included␣in␣the␣list␣item.␣For␣example, 91s `Markdown.pl`␣parses 91s 91s ```␣markdown 91s ␣␣␣-␣one 91s 91s ␣␣two 91s ``` 91s 91s as␣a␣single␣list␣item,␣with␣`two`␣a␣continuation␣paragraph: 91s 91s ```␣html 91s- 91s
foo
91sbar
91s91s
- baz
91s91s
91s ``` 91s 91s and␣similarly 91s 91s ```␣markdown 91s >␣␣␣-␣one 91s [93m 91s === got ==================== 91s [0m- 91s
one
91stwo
91s 91s
91s 91s [95m[Lists][0m 91s Test #187 91s [92mtick[0m 91s Test #188 91s [92mtick[0m 91s Test #189 91s [92mtick[0m 91s Test #190 91s [92mtick[0m 91s Test #191 91s [92mtick[0m 91s Test #192 91s [92mtick[0m 91s Test #193 91s [92mtick[0m 91s Test #194 91s [92mtick[0m 91s Test #195 91s [92mtick[0m 91s Test #196 91s [92mtick[0m 91s Test #197 91s [92mtick[0m 91s Test #198 91s [92mtick[0m 91s Test #199 91s [92mtick[0m 91s Test #200 91s [92mtick[0m 91s Test #201 91s [92mtick[0m 91s Test #202 91s [92mtick[0m 91s Test #203 91s [92mtick[0m 91s Test #204 91s [92mtick[0m 91s Test #205 91s [92mtick[0m 91s Test #206 91s [92mtick[0m 91s [95m[Inlines][0m 91s Test #207 91s [92mtick[0m 91s [95m[Backslash escapes][0m 91s Test #208 91s [92mtick[0m 91s Test #209 91s [92mtick[0m 91s Test #210 91s [92mtick[0m 91s Test #211 91s [92mtick[0m 91s Test #212 91s [92mtick[0m 91s Test #213 91s [92mtick[0m 91s Test #214 91s [92mtick[0m 91s Test #215 91s [92mtick[0m 91s Test #216 91s [92mtick[0m 91s Test #217 91s [92mtick[0m 91s Test #218 91s [92mtick[0m 91s Test #219 91s [92mtick[0m 91s Test #220 91s [92mtick[0m 91s [95m[Entities][0m 91s Test #221 91s [92mtick[0m 91s Test #222 91s [92mtick[0m 91s Test #223 91s [92mtick[0m 91s Test #224 91s [92mtick[0m 91s Test #225 91s [92mtick[0m 91s Test #226 91s [92mtick[0m 91s Test #227 91s [92mtick[0m 91s Test #228 91s [92mtick[0m 91s Test #229 91s [92mtick[0m 91s Test #230 91s [92mtick[0m 91s Test #231 91s [92mtick[0m 91s Test #232 91s [92mtick[0m 91s [95m[Code span][0m 91s Test #233 91s [92mtick[0m 91s Test #234 91s [92mtick[0m 91s Test #235 91s [92mtick[0m 91s Test #236 91s [92mtick[0m 91s Test #237 91s [92mtick[0m 91s Test #238 91s [92mtick[0m 91s Test #239 91s [92mtick[0m 91s Test #240 91s [92mtick[0m 91s Test #241 91s [92mtick[0m 91s Test #242 91s [92mtick[0m 91s Test #243 91s [92mtick[0m 91s Test #244 91s [92mtick[0m 91s Test #245 91s [92mtick[0m 91s [95m[Emphasis and strong emphasis][0m 91s Test #246 91s [92mtick[0m 91s Test #247 91s [92mtick[0m 91s Test #248 91s [92mtick[0m 91s Test #249 91s [92mtick[0m 91s Test #250 91s [92mtick[0m 91s Test #251 91s [92mtick[0m 91s Test #252 91s [92mtick[0m 91s Test #253 91s [92mtick[0m 91s Test #254 91s [92mtick[0m 91s Test #255 91s [92mtick[0m 91s Test #256 91s [92mtick[0m 91s Test #257 91s [92mtick[0m 91s Test #258 91s [92mtick[0m 91s Test #259 91s [92mtick[0m 91s Test #260 91s [92mtick[0m 91s Test #261 91s [92mtick[0m 91s Test #262 91s [92mtick[0m 91s Test #263 91s [92mtick[0m 91s Test #264 91s [92mtick[0m 91s Test #265 91s [92mtick[0m 91s Test #266 91s [92mtick[0m 91s Test #267 91s [92mtick[0m 91s Test #268 91s [92mtick[0m 91s Test #269 91s [92mtick[0m 91s Test #270 91s [92mtick[0m 91s Test #271 91s [92mtick[0m 91s Test #272 91s [92mtick[0m 91s Test #273 91s [92mtick[0m 91s Test #274 91s [92mtick[0m 91s Test #275 91s [92mtick[0m 91s Test #276 91s [92mtick[0m 91s Test #277 91s [92mtick[0m 91s Test #278 91s [92mtick[0m 91s Test #279 91s [92mtick[0m 91s Test #280 91s [92mtick[0m 91s Test #281 91s [92mtick[0m 91s Test #282 91s [92mtick[0m 91s Test #283 91s [92mtick[0m 91s Test #284 91s [92mtick[0m 91s Test #285 91s [92mtick[0m 91s Test #286 91s [92mtick[0m 91s Test #287 91s [92mtick[0m 91s Test #288 91s [92mtick[0m 91s Test #289 91s [92mtick[0m 91s Test #290 91s [92mtick[0m 91s Test #291 91s [92mtick[0m 91s Test #292 91s [92mtick[0m 91s Test #293 91s [92mtick[0m 91s Test #294 91s [92mtick[0m 91s Test #295 91s [92mtick[0m 91s Test #296 91s [92mtick[0m 91s Test #297 91s [92mtick[0m 91s Test #298 91s [92mtick[0m 91s Test #299 91s [92mtick[0m 91s Test #300 91s [92mtick[0m 91s Test #301 91s [92mtick[0m 91s Test #302 91s [92mtick[0m 91s Test #303 91s [92mtick[0m 91s Test #304 91s [92mtick[0m 91s Test #305 91s [92mtick[0m 91s Test #306 91s [92mtick[0m 91s Test #307 91s [92mtick[0m 91s Test #308 91s [92mtick[0m 91s Test #309 91s [92mtick[0m 91s Test #310 91s [92mtick[0m 91s Test #311 91s [92mtick[0m 91s Test #312 91s [92mtick[0m 91s Test #313 91s [92mtick[0m 91s Test #314 91s [92mtick[0m 91s Test #315 91s [92mtick[0m 91s Test #316 91s [92mtick[0m 91s Test #317 91s [92mtick[0m 91s Test #318 91s [92mtick[0m 91s Test #319 91s [92mtick[0m 91s Test #320 91s [92mtick[0m 91s Test #321 91s [92mtick[0m 91s Test #322 91s [92mtick[0m 91s Test #323 91s [92mtick[0m 91s Test #324 91s [92mtick[0m 91s Test #325 91s [92mtick[0m 91s Test #326 91s [92mtick[0m 91s Test #327 91s [92mtick[0m 91s [95m[Links][0m 91s Test #328 91s [92mtick[0m 91s Test #329 91s [92mtick[0m 91s Test #330 91s [92mtick[0m 91s Test #331 91s [92mtick[0m 91s Test #332 91s [92mtick[0m 91s Test #333 91s [92mtick[0m 91s Test #334 91s [92mtick[0m 91s Test #335 91s [92mtick[0m 91s Test #336 91s [92mtick[0m 91s Test #337 91s [92mtick[0m 91s Test #338 91s [92mtick[0m 91s Test #339 91s [92mtick[0m 91s Test #340 91s [92mtick[0m 91s Test #341 91s [92mtick[0m 91s Test #342 91s [92mtick[0m 91s Test #343 91s [92mtick[0m 91s Test #344 91s [92mtick[0m 91s Test #345 91s [92mtick[0m 91s Test #346 91s [92mtick[0m 91s Test #347 91s [92mtick[0m 91s Test #348 91s [92mtick[0m 91s Test #349 91s [92mtick[0m 91s Test #350 91s [92mtick[0m 91s Test #351 91s [92mtick[0m 91s Test #352 91s [92mtick[0m 91s Test #353 91s [92mtick[0m 91s Test #354 91s [92mtick[0m 91s Test #355 91s [92mtick[0m 91s Test #356 91s [92mtick[0m 91s Test #357 91s [92mtick[0m 91s Test #358 91s [92mtick[0m 91s Test #359 91s [92mtick[0m 91s Test #360 91s [92mtick[0m 91s Test #361 91s [92mtick[0m 91s Test #362 91s [92mtick[0m 91s Test #363 91s [92mtick[0m 91s Test #364 91s [92mtick[0m 91s Test #365 91s [92mtick[0m 91s Test #366 91s [92mtick[0m 91s Test #367 91s [92mtick[0m 91s Test #368 91s [92mtick[0m 91s Test #369 91s [92mtick[0m 91s Test #370 91s [92mtick[0m 91s Test #371 91s [92mtick[0m 91s Test #372 91s [92mtick[0m 91s Test #373 91s [92mtick[0m 91s Test #374 91s [92mtick[0m 91s Test #375 91s [92mtick[0m 91s [95m[Images][0m 91s Test #376 91s [92mtick[0m 91s Test #377 91s [92mtick[0m 91s Test #378 91s [92mtick[0m 91s Test #379 91s [92mtick[0m 91s Test #380 91s [92mtick[0m 91s Test #381 91s [92mtick[0m 91s Test #382 91s [92mtick[0m 91s Test #383 91s [92mtick[0m 91s Test #384 91s [92mtick[0m 91s Test #385 91s [92mtick[0m 91s Test #386 91s [92mtick[0m 91s Test #387 91s [92mtick[0m 91s Test #388 91s [92mtick[0m 91s Test #389 91s [92mtick[0m 91s Test #390 91s [92mtick[0m 91s Test #391 91s [92mtick[0m 91s Test #392 91s [92mtick[0m 91s Test #393 91s [92mtick[0m 91s Test #394 91s [92mtick[0m 91s Test #395 91s [92mtick[0m 91s [95m[Autolinks][0m 91s Test #396 91s [92mtick[0m 91s Test #397 91s [92mtick[0m 91s Test #398 91s [92mtick[0m 91s Test #399 91s [92mtick[0m 91s Test #400 91s [92mtick[0m 91s Test #401 91s [92mtick[0m 91s Test #402 91s [92mtick[0m 91s Test #403 91s [92mtick[0m 91s Test #404 91s [92mtick[0m 91s Test #405 91s [92mtick[0m 91s Test #406 91s [92mtick[0m 91s Test #407 91s [92mtick[0m 91s Test #408 91s [92mtick[0m 91s Test #409 91s [92mtick[0m 91s [95m[Raw HTML][0m 91s Test #410 91s [92mtick[0m 91s Test #411 91s [92mtick[0m 91s Test #412 91s [92mtick[0m 91s Test #413 91s [92mtick[0m 91s Test #414 91s [92mtick[0m 91s Test #415 91s [92mtick[0m 91s Test #416 91s [92mtick[0m 91s Test #417 91s [92mtick[0m 91s Test #418 91s [92mtick[0m 91s Test #419 91s [92mtick[0m 91s Test #420 91s [92mtick[0m 91s Test #421 91s [92mtick[0m 91s Test #422 91s [92mtick[0m 91s Test #423 91s [92mtick[0m 91s Test #424 91s [92mtick[0m 91s Test #425 91s [92mtick[0m 91s Test #426 91s [92mtick[0m 91s Test #427 91s [92mtick[0m 91s Test #428 91s [92mtick[0m 91s [95m[Hard line breaks][0m 91s Test #429 91s [92mtick[0m 91s Test #430 91s [92mtick[0m 91s Test #431 91s [92mtick[0m 91s Test #432 91s [92mtick[0m 91s Test #433 91s [92mtick[0m 91s Test #434 91s [92mtick[0m 91s Test #435 91s [92mtick[0m 91s Test #436 91s [92mtick[0m 91s Test #437 91s [92mtick[0m 91s Test #438 91s [92mtick[0m 91s Test #439 91s [92mtick[0m 91s [95m[Soft line breaks][0m 91s Test #440 91s [92mtick[0m 91s Test #441 91s [92mtick[0m 91s [95m[Strings][0m 91s Test #442 91s [92mtick[0m 91s Test #443 91s [92mtick[0m 91s Test #444 91s [92mtick[0m 91s 349 tests passed, 95 failed 91s runtime: 0.040982049s 91s autopkgtest [17:02:05]: test command1: -----------------------] 92s autopkgtest [17:02:06]: test command1: - - - - - - - - - - results - - - - - - - - - - 92s command1 PASS 92s autopkgtest [17:02:06]: @@@@@@@@@@@@@@@@@@@@ summary 92s command1 PASS