0s autopkgtest [17:20:35]: starting date and time: 2025-10-18 17:20:35+0000 0s autopkgtest [17:20:35]: git checkout: 4b346b80 nova: make wait_reboot return success even when a no-op 0s autopkgtest [17:20:35]: host juju-7f2275-prod-proposed-migration-environment-20; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.88fugskz/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-cpu2-ram4-disk20-amd64 --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-20@sto01-6.secgroup --name adt-resolute-amd64-commonmark-bkrs-20251018-172035-juju-7f2275-prod-proposed-migration-environment-20-e88c0425-023b-450b-99e7-9c2ce87b67eb --image adt/ubuntu-resolute-amd64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-20 --net-id=net_prod-autopkgtest-workers-amd64 -e TERM=linux --mirror=http://ftpmaster.internal/ubuntu/ 3s Creating nova instance adt-resolute-amd64-commonmark-bkrs-20251018-172035-juju-7f2275-prod-proposed-migration-environment-20-e88c0425-023b-450b-99e7-9c2ce87b67eb from image adt/ubuntu-resolute-amd64-server-20251018.img (UUID dd697a48-b6cc-4a02-84bf-0f9f2fad5f89)... 28s autopkgtest [17:21:03]: testbed dpkg architecture: amd64 28s autopkgtest [17:21:03]: testbed apt version: 3.1.6ubuntu2 28s autopkgtest [17:21:03]: @@@@@@@@@@@@@@@@@@@@ test bed setup 28s autopkgtest [17:21:03]: testbed release detected to be: None 29s autopkgtest [17:21:04]: updating testbed package index (apt update) 29s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease [83.3 kB] 29s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 29s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 29s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 29s Get:5 http://ftpmaster.internal/ubuntu resolute-proposed/universe Sources [345 kB] 29s Get:6 http://ftpmaster.internal/ubuntu resolute-proposed/restricted Sources [5028 B] 29s Get:7 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse Sources [15.4 kB] 29s Get:8 http://ftpmaster.internal/ubuntu resolute-proposed/main Sources [28.4 kB] 29s Get:9 http://ftpmaster.internal/ubuntu resolute-proposed/main i386 Packages [46.6 kB] 29s Get:10 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 Packages [85.2 kB] 29s Get:11 http://ftpmaster.internal/ubuntu resolute-proposed/restricted amd64 Packages [28.0 kB] 30s Get:12 http://ftpmaster.internal/ubuntu resolute-proposed/restricted i386 Packages [3208 B] 30s Get:13 http://ftpmaster.internal/ubuntu resolute-proposed/universe amd64 Packages [233 kB] 30s Get:14 http://ftpmaster.internal/ubuntu resolute-proposed/universe i386 Packages [87.6 kB] 30s Get:15 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse amd64 Packages [8376 B] 30s Get:16 http://ftpmaster.internal/ubuntu resolute-proposed/multiverse i386 Packages [2772 B] 30s Fetched 972 kB in 1s (1712 kB/s) 30s Reading package lists... 31s Hit:1 http://ftpmaster.internal/ubuntu resolute-proposed InRelease 31s Hit:2 http://ftpmaster.internal/ubuntu resolute InRelease 31s Hit:3 http://ftpmaster.internal/ubuntu resolute-updates InRelease 31s Hit:4 http://ftpmaster.internal/ubuntu resolute-security InRelease 31s Reading package lists... 31s Reading package lists... 31s Building dependency tree... 31s Reading state information... 32s Calculating upgrade... 32s The following packages will be upgraded: 32s apt gir1.2-girepository-2.0 libapt-pkg7.0 libgirepository-1.0-1 32s libpython3-stdlib python3 python3-minimal 32s 7 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 32s Need to get 2751 kB of archives. 32s After this operation, 2048 B of additional disk space will be used. 32s Get:1 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3-minimal amd64 3.13.7-2 [27.8 kB] 32s Get:2 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 python3 amd64 3.13.7-2 [23.9 kB] 32s Get:3 http://ftpmaster.internal/ubuntu resolute-proposed/main amd64 libpython3-stdlib amd64 3.13.7-2 [10.6 kB] 32s Get:4 http://ftpmaster.internal/ubuntu resolute/main amd64 libapt-pkg7.0 amd64 3.1.8ubuntu1 [1140 kB] 32s Get:5 http://ftpmaster.internal/ubuntu resolute/main amd64 apt amd64 3.1.8ubuntu1 [1438 kB] 32s Get:6 http://ftpmaster.internal/ubuntu resolute/main amd64 libgirepository-1.0-1 amd64 1.86.0-6 [85.9 kB] 32s Get:7 http://ftpmaster.internal/ubuntu resolute/main amd64 gir1.2-girepository-2.0 amd64 1.86.0-6 [25.3 kB] 32s dpkg-preconfigure: unable to re-open stdin: No such file or directory 32s Fetched 2751 kB in 0s (6934 kB/s) 32s (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 ... 78439 files and directories currently installed.) 32s Preparing to unpack .../python3-minimal_3.13.7-2_amd64.deb ... 32s Unpacking python3-minimal (3.13.7-2) over (3.13.7-1) ... 32s Setting up python3-minimal (3.13.7-2) ... 32s (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 ... 78439 files and directories currently installed.) 32s Preparing to unpack .../0-python3_3.13.7-2_amd64.deb ... 33s running python pre-rtupdate hooks for python3.13... 33s Unpacking python3 (3.13.7-2) over (3.13.7-1) ... 33s Preparing to unpack .../1-libpython3-stdlib_3.13.7-2_amd64.deb ... 33s Unpacking libpython3-stdlib:amd64 (3.13.7-2) over (3.13.7-1) ... 33s Preparing to unpack .../2-libapt-pkg7.0_3.1.8ubuntu1_amd64.deb ... 33s Unpacking libapt-pkg7.0:amd64 (3.1.8ubuntu1) over (3.1.6ubuntu2) ... 33s Preparing to unpack .../3-apt_3.1.8ubuntu1_amd64.deb ... 33s Unpacking apt (3.1.8ubuntu1) over (3.1.6ubuntu2) ... 33s Preparing to unpack .../4-libgirepository-1.0-1_1.86.0-6_amd64.deb ... 33s Unpacking libgirepository-1.0-1:amd64 (1.86.0-6) over (1.84.0-1) ... 33s Preparing to unpack .../5-gir1.2-girepository-2.0_1.86.0-6_amd64.deb ... 33s Unpacking gir1.2-girepository-2.0:amd64 (1.86.0-6) over (1.84.0-1) ... 33s Setting up libgirepository-1.0-1:amd64 (1.86.0-6) ... 33s Setting up libapt-pkg7.0:amd64 (3.1.8ubuntu1) ... 33s Setting up libpython3-stdlib:amd64 (3.13.7-2) ... 33s Setting up apt (3.1.8ubuntu1) ... 33s Setting up python3 (3.13.7-2) ... 33s running python rtupdate hooks for python3.13... 33s running python post-rtupdate hooks for python3.13... 33s Setting up gir1.2-girepository-2.0:amd64 (1.86.0-6) ... 33s Processing triggers for man-db (2.13.1-1) ... 34s Processing triggers for libc-bin (2.42-0ubuntu3) ... 34s autopkgtest [17:21:09]: upgrading testbed (apt dist-upgrade and autopurge) 35s Reading package lists... 35s Building dependency tree... 35s Reading state information... 35s Calculating upgrade... 35s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 35s Reading package lists... 35s Building dependency tree... 35s Reading state information... 35s Solving dependencies... 35s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 36s autopkgtest [17:21:11]: rebooting testbed after setup commands that affected boot 50s autopkgtest [17:21:25]: testbed running kernel: Linux 6.17.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 10:00:33 UTC 2025 52s autopkgtest [17:21:27]: @@@@@@@@@@@@@@@@@@@@ apt-source commonmark-bkrs 54s Get:1 http://ftpmaster.internal/ubuntu resolute/universe commonmark-bkrs 0.5.4+ds-7.1 (dsc) [2272 B] 54s Get:2 http://ftpmaster.internal/ubuntu resolute/universe commonmark-bkrs 0.5.4+ds-7.1 (tar) [81.9 kB] 54s Get:3 http://ftpmaster.internal/ubuntu resolute/universe commonmark-bkrs 0.5.4+ds-7.1 (diff) [6860 B] 54s gpgv: Signature made Thu Feb 8 00:40:02 2024 UTC 54s gpgv: using RSA key D56571B88A8BBAF140BF63D6BD7EAA60778FA6F5 54s gpgv: issuer "doko@debian.org" 54s gpgv: Can't check signature: No public key 54s dpkg-source: warning: cannot verify inline signature for ./commonmark-bkrs_0.5.4+ds-7.1.dsc: no acceptable signature found 54s autopkgtest [17:21:29]: testing package commonmark-bkrs version 0.5.4+ds-7.1 54s autopkgtest [17:21:29]: build not needed 54s autopkgtest [17:21:29]: test command1: preparing testbed 54s Reading package lists... 54s Building dependency tree... 54s Reading state information... 54s Solving dependencies... 55s The following NEW packages will be installed: 55s python-commonmark-bkrs-doc python3-commonmark-bkrs 55s 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 55s Need to get 95.7 kB of archives. 55s After this operation, 1084 kB of additional disk space will be used. 55s Get:1 http://ftpmaster.internal/ubuntu resolute/universe amd64 python-commonmark-bkrs-doc all 0.5.4+ds-7.1 [64.2 kB] 55s Get:2 http://ftpmaster.internal/ubuntu resolute/universe amd64 python3-commonmark-bkrs all 0.5.4+ds-7.1 [31.4 kB] 55s Fetched 95.7 kB in 0s (447 kB/s) 55s Selecting previously unselected package python-commonmark-bkrs-doc. 55s (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 ... 78439 files and directories currently installed.) 55s Preparing to unpack .../python-commonmark-bkrs-doc_0.5.4+ds-7.1_all.deb ... 55s Unpacking python-commonmark-bkrs-doc (0.5.4+ds-7.1) ... 55s Selecting previously unselected package python3-commonmark-bkrs. 55s Preparing to unpack .../python3-commonmark-bkrs_0.5.4+ds-7.1_all.deb ... 55s Unpacking python3-commonmark-bkrs (0.5.4+ds-7.1) ... 55s Setting up python-commonmark-bkrs-doc (0.5.4+ds-7.1) ... 55s Setting up python3-commonmark-bkrs (0.5.4+ds-7.1) ... 55s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:186: SyntaxWarning: invalid escape sequence '\s' 55s return bool(re.compile("^\s*$").match(s)) 55s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:338: SyntaxWarning: invalid escape sequence '\/' 55s "^<([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])?)*)>") 55s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:385: SyntaxWarning: invalid escape sequence '\s' 55s numdelims <= 3) and (not re.match("\s", char_after)) 55s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:387: SyntaxWarning: invalid escape sequence '\s' 55s numdelims <= 3) and (not re.match("\s", char_before)) 55s /usr/lib/python3/dist-packages/CommonMark_bkrs/CommonMark.py:1008: SyntaxWarning: invalid escape sequence '\g' 55s re.sub(r'(?:(\\#) *#*| *#+) *$', '\g<1>', ln[offset:])] 55s Processing triggers for man-db (2.13.1-1) ... 56s autopkgtest [17:21:31]: test command1: cd /usr/share/doc/python-commonmark-bkrs-doc/tests/ && python3 test-CommonMark.py 56s autopkgtest [17:21:31]: test command1: [----------------------- 56s /usr/share/doc/python-commonmark-bkrs-doc/examples/tests/test-CommonMark.py:67: SyntaxWarning: invalid escape sequence '\.' 56s testMatch = re.findall(re.compile("^\.\n([\s\S]*?)^\.\n([\s\S]*?)^.$|^#{1,6} *(.*)$", re.M), tests) 57s [Preprocessing] 57s Test #1 57s tick 57s Test #2 57s tick 57s [Precedence] 57s Test #3 57s tick 57s [Horizontal rules] 57s Test #4 57s tick 57s Test #5 57s tick 57s Test #6 57s tick 57s Test #7 57s tick 57s Test #8 57s tick 57s Test #9 57s tick 57s Test #10 57s tick 57s Test #11 57s tick 57s Test #12 57s tick 57s Test #13 57s tick 57s Test #14 57s tick 57s Test #15 57s tick 57s Test #16 57s tick 57s Test #17 57s tick 57s Test #18 57s tick 57s Test #19 57s tick 57s Test #20 57s tick 57s Test #21 57s tick 57s Test #22 57s tick 57s [ATX headers] 57s Test #23 57s tick 57s Test #24 57s tick 57s Test #25 57s tick 57s Test #26 57s tick 57s Test #27 57s tick 57s Test #28 57s tick 57s Test #29 57s tick 57s Test #30 57s tick 57s Test #31 57s tick 57s Test #32 57s tick 57s Test #33 57s tick 57s Test #34 57s tick 57s Test #35 57s tick 57s Test #36 57s tick 57s Test #37 57s tick 57s Test #38 57s tick 57s Test #39 57s tick 57s [Setext headers] 57s Test #40 57s tick 57s Test #41 57s tick 57s Test #42 57s tick 57s Test #43 57s tick 57s Test #44 57s tick 57s Test #45 57s tick 57s Test #46 57s tick 57s Test #47 57s tick 57s Test #48 57s tick 57s Test #49 57s tick 57s Test #50 57s tick 57s Test #51 57s tick 57s Test #52 57s tick 57s Test #53 57s tick 57s [Indented code blocks] 57s Test #54 57s tick 57s Test #55 57s tick 57s Test #56 57s tick 57s Test #57 57s tick 57s Test #58 57s tick 57s Test #59 57s tick 57s Test #60 57s tick 57s Test #61 57s tick 57s Test #62 57s cross 57s === markdown =============== 57s  57s ␣␣␣␣ 57s ␣␣␣␣foo 57s ␣␣␣␣ 57s 57s  57s === expected =============== 57s 
foo
 57s 
57s  57s === got ==================== 57s 
foo
 57s 
 57s 
57s 57s Test #63 57s tick 57s [Fenced code blocks] 57s Test #64 57s tick 57s Test #65 57s tick 57s Test #66 57s tick 57s Test #67 57s tick 57s Test #68 57s tick 57s Test #69 57s tick 57s Test #70 57s tick 57s Test #71 57s tick 57s Test #72 57s tick 57s Test #73 57s tick 57s Test #74 57s tick 57s Test #75 57s tick 57s Test #76 57s tick 57s Test #77 57s tick 57s Test #78 57s tick 57s Test #79 57s tick 57s Test #80 57s tick 57s Test #81 57s tick 57s Test #82 57s tick 57s Test #83 57s tick 57s Test #84 57s tick 57s Test #85 57s tick 57s Test #86 57s tick 57s [HTML blocks] 57s Test #87 57s tick 57s Test #88 57s tick 57s Test #89 57s tick 57s Test #90 57s tick 57s Test #91 57s tick 57s Test #92 57s tick 57s Test #93 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s  57s 57s Test #94 57s cross 57s === markdown =============== 57s  57s The␣opening␣tag␣can␣be␣indented␣1-3␣spaces,␣but␣not␣4: 57s 57s  57s === expected =============== 57s ␣␣ 57s 57s ␣␣␣␣ 57s  57s === got ==================== 57s 

The␣opening␣tag␣can␣be␣indented␣1-3␣spaces,␣but␣not␣4:

57s 57s Test #95 57s cross 57s === markdown =============== 57s  57s An␣HTML␣block␣can␣interrupt␣a␣paragraph,␣and␣need␣not␣be␣preceded 57s by␣a␣blank␣line. 57s 57s  57s === expected =============== 57s Foo 57s
57s bar 57s
57s  57s === got ==================== 57s 

An␣HTML␣block␣can␣interrupt␣a␣paragraph,␣and␣need␣not␣be␣preceded 57s by␣a␣blank␣line.

57s 57s Test #96 57s cross 57s === markdown =============== 57s  57s However,␣a␣following␣blank␣line␣is␣always␣needed,␣except␣at␣the␣end␣of 57s a␣document: 57s 57s  57s === expected =============== 57s 
57s bar 57s
57s *foo* 57s  57s === got ==================== 57s 

However,␣a␣following␣blank␣line␣is␣always␣needed,␣except␣at␣the␣end␣of 57s a␣document:

57s 57s Test #97 57s cross 57s === markdown =============== 57s  57s An␣incomplete␣HTML␣block␣tag␣may␣also␣start␣an␣HTML␣block: 57s 57s  57s === expected =============== 57s An␣incomplete␣HTML␣block␣tag␣may␣also␣start␣an␣HTML␣block:

57s 57s Test #98 57s cross 57s === markdown =============== 57s  57s This␣rule␣differs␣from␣John␣Gruber's␣original␣Markdown␣syntax 57s specification,␣which␣says: 57s 57s >␣The␣only␣restrictions␣are␣that␣block-level␣HTML␣elements␣— 57s >␣e.g.␣`
`,␣``,␣`
`,␣`

`,␣etc.␣—␣must␣be␣separated␣from 57s >␣surrounding␣content␣by␣blank␣lines,␣and␣the␣start␣and␣end␣tags␣of␣the 57s >␣block␣should␣not␣be␣indented␣with␣tabs␣or␣spaces. 57s 57s In␣some␣ways␣Gruber's␣rule␣is␣more␣restrictive␣than␣the␣one␣given 57s here: 57s 57s -␣It␣requires␣that␣an␣HTML␣block␣be␣preceded␣by␣a␣blank␣line. 57s -␣It␣does␣not␣allow␣the␣start␣tag␣to␣be␣indented. 57s -␣It␣requires␣a␣matching␣end␣tag,␣which␣it␣also␣does␣not␣allow␣to 57s ␣␣be␣indented. 57s 57s Indeed,␣most␣Markdown␣implementations,␣including␣some␣of␣Gruber's 57s own␣perl␣implementations,␣do␣not␣impose␣these␣restrictions. 57s 57s There␣is␣one␣respect,␣however,␣in␣which␣Gruber's␣rule␣is␣more␣liberal 57s than␣the␣one␣given␣here,␣since␣it␣allows␣blank␣lines␣to␣occur␣inside 57s an␣HTML␣block.␣␣There␣are␣two␣reasons␣for␣disallowing␣them␣here. 57s First,␣it␣removes␣the␣need␣to␣parse␣balanced␣tags,␣which␣is 57s expensive␣and␣can␣require␣backtracking␣from␣the␣end␣of␣the␣document 57s if␣no␣matching␣end␣tag␣is␣found.␣Second,␣it␣provides␣a␣very␣simple 57s and␣flexible␣way␣of␣including␣Markdown␣content␣inside␣HTML␣tags: 57s simply␣separate␣the␣Markdown␣from␣the␣HTML␣using␣blank␣lines: 57s 57s  57s === expected =============== 57s 

57s 57s *Emphasized*␣text. 57s 57s
57s  57s === got ==================== 57s 

This␣rule␣differs␣from␣John␣Gruber's␣original␣Markdown␣syntax 57s specification,␣which␣says:

57s
57s

The␣only␣restrictions␣are␣that␣block-level␣HTML␣elements␣— 57s e.g.␣<div>,␣<table>,␣<pre>,␣<p>,␣etc.␣—␣must␣be␣separated␣from 57s surrounding␣content␣by␣blank␣lines,␣and␣the␣start␣and␣end␣tags␣of␣the 57s block␣should␣not␣be␣indented␣with␣tabs␣or␣spaces.

57s
57s

In␣some␣ways␣Gruber's␣rule␣is␣more␣restrictive␣than␣the␣one␣given 57s here:

57s
    57s
  • It␣requires␣that␣an␣HTML␣block␣be␣preceded␣by␣a␣blank␣line.
  • 57s
  • It␣does␣not␣allow␣the␣start␣tag␣to␣be␣indented.
  • 57s
  • It␣requires␣a␣matching␣end␣tag,␣which␣it␣also␣does␣not␣allow␣to 57s be␣indented.
  • 57s
57s

Indeed,␣most␣Markdown␣implementations,␣including␣some␣of␣Gruber's 57s own␣perl␣implementations,␣do␣not␣impose␣these␣restrictions.

57s

There␣is␣one␣respect,␣however,␣in␣which␣Gruber's␣rule␣is␣more␣liberal 57s than␣the␣one␣given␣here,␣since␣it␣allows␣blank␣lines␣to␣occur␣inside 57s an␣HTML␣block.␣␣There␣are␣two␣reasons␣for␣disallowing␣them␣here. 57s First,␣it␣removes␣the␣need␣to␣parse␣balanced␣tags,␣which␣is 57s expensive␣and␣can␣require␣backtracking␣from␣the␣end␣of␣the␣document 57s if␣no␣matching␣end␣tag␣is␣found.␣Second,␣it␣provides␣a␣very␣simple 57s and␣flexible␣way␣of␣including␣Markdown␣content␣inside␣HTML␣tags: 57s simply␣separate␣the␣Markdown␣from␣the␣HTML␣using␣blank␣lines:

57s 57s Test #99 57s cross 57s === markdown =============== 57s  57s Compare: 57s 57s  57s === expected =============== 57s 
57s *Emphasized*␣text. 57s
57s  57s === got ==================== 57s 

Compare:

57s 57s Test #100 57s cross 57s === markdown =============== 57s  57s Some␣Markdown␣implementations␣have␣adopted␣a␣convention␣of 57s interpreting␣content␣inside␣tags␣as␣text␣if␣the␣open␣tag␣has 57s the␣attribute␣`markdown=1`.␣␣The␣rule␣given␣above␣seems␣a␣simpler␣and 57s more␣elegant␣way␣of␣achieving␣the␣same␣expressive␣power,␣which␣is␣also 57s much␣simpler␣to␣parse. 57s 57s The␣main␣potential␣drawback␣is␣that␣one␣can␣no␣longer␣paste␣HTML 57s blocks␣into␣Markdown␣documents␣with␣100%␣reliability.␣␣However, 57s *in␣most␣cases*␣this␣will␣work␣fine,␣because␣the␣blank␣lines␣in 57s HTML␣are␣usually␣followed␣by␣HTML␣block␣tags.␣␣For␣example: 57s 57s  57s === expected =============== 57s 
57s 57s 57s 57s 57s 57s 57s 57s
57s Hi 57s
57s  57s === got ==================== 57s 

Some␣Markdown␣implementations␣have␣adopted␣a␣convention␣of 57s interpreting␣content␣inside␣tags␣as␣text␣if␣the␣open␣tag␣has 57s the␣attribute␣markdown=1.␣␣The␣rule␣given␣above␣seems␣a␣simpler␣and 57s more␣elegant␣way␣of␣achieving␣the␣same␣expressive␣power,␣which␣is␣also 57s much␣simpler␣to␣parse.

57s

The␣main␣potential␣drawback␣is␣that␣one␣can␣no␣longer␣paste␣HTML 57s blocks␣into␣Markdown␣documents␣with␣100%␣reliability.␣␣However, 57s in␣most␣cases␣this␣will␣work␣fine,␣because␣the␣blank␣lines␣in 57s HTML␣are␣usually␣followed␣by␣HTML␣block␣tags.␣␣For␣example:

57s 57s Test #101 57s cross 57s === markdown =============== 57s  57s Moreover,␣blank␣lines␣are␣usually␣not␣necessary␣and␣can␣be 57s deleted.␣␣The␣exception␣is␣inside␣`
`␣tags;␣here,␣one␣can
 57s replace␣the␣blank␣lines␣with␣`
`␣entities.
 57s 
 57s So␣there␣is␣no␣important␣loss␣of␣expressive␣power␣with␣the␣new␣rule.
 57s 
 57s ##␣Link␣reference␣definitions
 57s 
 57s A␣[link␣reference␣definition](#link-reference-definition)
 57s ␣consists␣of␣a␣[link
 57s label](#link-label),␣indented␣up␣to␣three␣spaces,␣followed
 57s by␣a␣colon␣(`:`),␣optional␣blank␣space␣(including␣up␣to␣one
 57s newline),␣a␣[link␣destination](#link-destination),␣optional
 57s blank␣space␣(including␣up␣to␣one␣newline),␣and␣an␣optional␣[link
 57s title](#link-title),␣which␣if␣it␣is␣present␣must␣be␣separated
 57s from␣the␣[link␣destination](#link-destination)␣by␣whitespace.
 57s No␣further␣non-space␣characters␣may␣occur␣on␣the␣line.
 57s 
 57s A␣[link␣reference-definition](#link-reference-definition)
 57s does␣not␣correspond␣to␣a␣structural␣element␣of␣a␣document.␣␣Instead,␣it
 57s defines␣a␣label␣which␣can␣be␣used␣in␣[reference␣links](#reference-link)
 57s and␣reference-style␣[images](#image)␣elsewhere␣in␣the␣document.␣␣[Link
 57s reference␣definitions]␣can␣come␣either␣before␣or␣after␣the␣links␣that␣use
 57s them.
 57s 
 57s 
 57s === expected ===============
 57s [foo]:␣/url␣"title"
 57s 
 57s [foo]
 57s 
 57s === got ====================
 57s 

Moreover,␣blank␣lines␣are␣usually␣not␣necessary␣and␣can␣be 57s deleted.␣␣The␣exception␣is␣inside␣<pre>␣tags;␣here,␣one␣can 57s replace␣the␣blank␣lines␣with␣&#10;␣entities.

57s

So␣there␣is␣no␣important␣loss␣of␣expressive␣power␣with␣the␣new␣rule.

57s

Link␣reference␣definitions

57s

A␣link␣reference␣definition 57s ␣consists␣of␣a␣link 57s label,␣indented␣up␣to␣three␣spaces,␣followed 57s by␣a␣colon␣(:),␣optional␣blank␣space␣(including␣up␣to␣one 57s newline),␣a␣link␣destination,␣optional 57s blank␣space␣(including␣up␣to␣one␣newline),␣and␣an␣optional␣link 57s title,␣which␣if␣it␣is␣present␣must␣be␣separated 57s from␣the␣link␣destination␣by␣whitespace. 57s No␣further␣non-space␣characters␣may␣occur␣on␣the␣line.

57s

A␣link␣reference-definition 57s does␣not␣correspond␣to␣a␣structural␣element␣of␣a␣document.␣␣Instead,␣it 57s defines␣a␣label␣which␣can␣be␣used␣in␣reference␣links 57s and␣reference-style␣images␣elsewhere␣in␣the␣document.␣␣[Link 57s reference␣definitions]␣can␣come␣either␣before␣or␣after␣the␣links␣that␣use 57s them.

57s 57s Test #102 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s ␣␣␣[foo]:␣ 57s ␣␣␣␣␣␣/url␣␣ 57s ␣␣␣␣␣␣␣␣␣␣␣'the␣title'␣␣ 57s 57s [foo] 57s  57s === got ==================== 57s  57s Test #103 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s [Foo*bar\]]:my_(url)␣'title␣(with␣parens)' 57s 57s [Foo*bar\]] 57s  57s === got ==================== 57s  57s Test #104 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s [Foo␣bar]: 57s 57s 'title' 57s 57s [Foo␣bar] 57s  57s === got ==================== 57s  57s Test #105 57s cross 57s === markdown =============== 57s  57s The␣title␣may␣be␣omitted: 57s 57s  57s === expected =============== 57s [foo]: 57s /url 57s 57s [foo] 57s  57s === got ==================== 57s 

The␣title␣may␣be␣omitted:

57s 57s Test #106 57s cross 57s === markdown =============== 57s  57s The␣link␣destination␣may␣not␣be␣omitted: 57s 57s  57s === expected =============== 57s [foo]: 57s 57s [foo] 57s  57s === got ==================== 57s 

The␣link␣destination␣may␣not␣be␣omitted:

57s 57s Test #107 57s cross 57s === markdown =============== 57s  57s A␣link␣can␣come␣before␣its␣corresponding␣definition: 57s 57s  57s === expected =============== 57s [foo] 57s 57s [foo]:␣url 57s  57s === got ==================== 57s 

A␣link␣can␣come␣before␣its␣corresponding␣definition:

57s 57s Test #108 57s cross 57s === markdown =============== 57s  57s If␣there␣are␣several␣matching␣definitions,␣the␣first␣one␣takes 57s precedence: 57s 57s  57s === expected =============== 57s [foo] 57s 57s [foo]:␣first 57s [foo]:␣second 57s  57s === got ==================== 57s 

If␣there␣are␣several␣matching␣definitions,␣the␣first␣one␣takes 57s precedence:

57s 57s Test #109 57s cross 57s === markdown =============== 57s  57s As␣noted␣in␣the␣section␣on␣[Links],␣matching␣of␣labels␣is 57s case-insensitive␣(see␣[matches](#matches)). 57s 57s  57s === expected =============== 57s [FOO]:␣/url 57s 57s [Foo] 57s  57s === got ==================== 57s 

As␣noted␣in␣the␣section␣on␣[Links],␣matching␣of␣labels␣is 57s case-insensitive␣(see␣matches).

57s 57s Test #110 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s [ΑΓΩ]:␣/φου 57s 57s [αγω] 57s  57s === got ==================== 57s  57s Test #111 57s cross 57s === markdown =============== 57s  57s Here␣is␣a␣link␣reference␣definition␣with␣no␣corresponding␣link. 57s It␣contributes␣nothing␣to␣the␣document. 57s 57s  57s === expected =============== 57s [foo]:␣/url 57s  57s === got ==================== 57s 

Here␣is␣a␣link␣reference␣definition␣with␣no␣corresponding␣link. 57s It␣contributes␣nothing␣to␣the␣document.

57s 57s Test #112 57s cross 57s === markdown =============== 57s  57s This␣is␣not␣a␣link␣reference␣definition,␣because␣there␣are 57s non-space␣characters␣after␣the␣title: 57s 57s  57s === expected =============== 57s [foo]:␣/url␣"title"␣ok 57s  57s === got ==================== 57s 

This␣is␣not␣a␣link␣reference␣definition,␣because␣there␣are 57s non-space␣characters␣after␣the␣title:

57s 57s Test #113 57s cross 57s === markdown =============== 57s  57s This␣is␣not␣a␣link␣reference␣definition,␣because␣it␣is␣indented 57s four␣spaces: 57s 57s  57s === expected =============== 57s ␣␣␣␣[foo]:␣/url␣"title" 57s 57s [foo] 57s  57s === got ==================== 57s 

This␣is␣not␣a␣link␣reference␣definition,␣because␣it␣is␣indented 57s four␣spaces:

57s 57s Test #114 57s cross 57s === markdown =============== 57s  57s This␣is␣not␣a␣link␣reference␣definition,␣because␣it␣occurs␣inside 57s a␣code␣block: 57s 57s  57s === expected =============== 57s ``` 57s [foo]:␣/url 57s ``` 57s 57s [foo] 57s  57s === got ==================== 57s 

This␣is␣not␣a␣link␣reference␣definition,␣because␣it␣occurs␣inside 57s a␣code␣block:

57s 57s Test #115 57s cross 57s === markdown =============== 57s  57s A␣[link␣reference␣definition](#link-reference-definition)␣cannot 57s interrupt␣a␣paragraph. 57s 57s  57s === expected =============== 57s Foo 57s [bar]:␣/baz 57s 57s [bar] 57s  57s === got ==================== 57s 

A␣link␣reference␣definition␣cannot 57s interrupt␣a␣paragraph.

57s 57s Test #116 57s cross 57s === markdown =============== 57s  57s However,␣it␣can␣directly␣follow␣other␣block␣elements,␣such␣as␣headers 57s and␣horizontal␣rules,␣and␣it␣need␣not␣be␣followed␣by␣a␣blank␣line. 57s 57s  57s === expected =============== 57s #␣[Foo] 57s [foo]:␣/url 57s >␣bar 57s  57s === got ==================== 57s 

However,␣it␣can␣directly␣follow␣other␣block␣elements,␣such␣as␣headers 57s and␣horizontal␣rules,␣and␣it␣need␣not␣be␣followed␣by␣a␣blank␣line.

57s 57s Test #117 57s cross 57s === markdown =============== 57s  57s Several␣[link␣references](#link-reference)␣can␣occur␣one␣after␣another, 57s without␣intervening␣blank␣lines. 57s 57s  57s === expected =============== 57s [foo]:␣/foo-url␣"foo" 57s [bar]:␣/bar-url 57s ␣␣"bar" 57s [baz]:␣/baz-url 57s 57s [foo], 57s [bar], 57s [baz] 57s  57s === got ==================== 57s 

Several␣link␣references␣can␣occur␣one␣after␣another, 57s without␣intervening␣blank␣lines.

57s 57s Test #118 57s cross 57s === markdown =============== 57s  57s [Link␣reference␣definitions](#link-reference-definition)␣can␣occur 57s inside␣block␣containers,␣like␣lists␣and␣block␣quotations.␣␣They 57s affect␣the␣entire␣document,␣not␣just␣the␣container␣in␣which␣they 57s are␣defined: 57s 57s  57s === expected =============== 57s [foo] 57s 57s >␣[foo]:␣/url 57s  57s === got ==================== 57s 

Link␣reference␣definitions␣can␣occur 57s inside␣block␣containers,␣like␣lists␣and␣block␣quotations.␣␣They 57s affect␣the␣entire␣document,␣not␣just␣the␣container␣in␣which␣they 57s are␣defined:

57s 57s Test #119 57s cross 57s === markdown =============== 57s  57s 57s ##␣Paragraphs 57s 57s A␣sequence␣of␣non-blank␣lines␣that␣cannot␣be␣interpreted␣as␣other 57s kinds␣of␣blocks␣forms␣a␣[paragraph](#paragraph). 57s The␣contents␣of␣the␣paragraph␣are␣the␣result␣of␣parsing␣the 57s paragraph's␣raw␣content␣as␣inlines.␣␣The␣paragraph's␣raw␣content 57s is␣formed␣by␣concatenating␣the␣lines␣and␣removing␣initial␣and␣final 57s spaces. 57s 57s A␣simple␣example␣with␣two␣paragraphs: 57s 57s  57s === expected =============== 57s aaa 57s 57s bbb 57s  57s === got ==================== 57s 

Paragraphs

57s

A␣sequence␣of␣non-blank␣lines␣that␣cannot␣be␣interpreted␣as␣other 57s kinds␣of␣blocks␣forms␣a␣paragraph. 57s The␣contents␣of␣the␣paragraph␣are␣the␣result␣of␣parsing␣the 57s paragraph's␣raw␣content␣as␣inlines.␣␣The␣paragraph's␣raw␣content 57s is␣formed␣by␣concatenating␣the␣lines␣and␣removing␣initial␣and␣final 57s spaces.

57s

A␣simple␣example␣with␣two␣paragraphs:

57s 57s Test #120 57s cross 57s === markdown =============== 57s  57s Paragraphs␣can␣contain␣multiple␣lines,␣but␣no␣blank␣lines: 57s 57s  57s === expected =============== 57s aaa 57s bbb 57s 57s ccc 57s ddd 57s  57s === got ==================== 57s 

Paragraphs␣can␣contain␣multiple␣lines,␣but␣no␣blank␣lines:

57s 57s Test #121 57s cross 57s === markdown =============== 57s  57s Multiple␣blank␣lines␣between␣paragraph␣have␣no␣effect: 57s 57s  57s === expected =============== 57s aaa 57s 57s 57s bbb 57s  57s === got ==================== 57s 

Multiple␣blank␣lines␣between␣paragraph␣have␣no␣effect:

57s 57s Test #122 57s cross 57s === markdown =============== 57s  57s Leading␣spaces␣are␣skipped: 57s 57s  57s === expected =============== 57s ␣␣aaa 57s ␣bbb 57s  57s === got ==================== 57s 

Leading␣spaces␣are␣skipped:

57s 57s Test #123 57s cross 57s === markdown =============== 57s  57s Lines␣after␣the␣first␣may␣be␣indented␣any␣amount,␣since␣indented 57s code␣blocks␣cannot␣interrupt␣paragraphs. 57s 57s  57s === expected =============== 57s aaa 57s ␣␣␣␣␣␣␣␣␣␣␣␣␣bbb 57s ␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣ccc 57s  57s === got ==================== 57s 

Lines␣after␣the␣first␣may␣be␣indented␣any␣amount,␣since␣indented 57s code␣blocks␣cannot␣interrupt␣paragraphs.

57s 57s Test #124 57s cross 57s === markdown =============== 57s  57s However,␣the␣first␣line␣may␣be␣indented␣at␣most␣three␣spaces, 57s or␣an␣indented␣code␣block␣will␣be␣triggered: 57s 57s  57s === expected =============== 57s ␣␣␣aaa 57s bbb 57s  57s === got ==================== 57s 

However,␣the␣first␣line␣may␣be␣indented␣at␣most␣three␣spaces, 57s or␣an␣indented␣code␣block␣will␣be␣triggered:

57s 57s Test #125 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s ␣␣␣␣aaa 57s bbb 57s  57s === got ==================== 57s  57s Test #126 57s cross 57s === markdown =============== 57s  57s Final␣spaces␣are␣stripped␣before␣inline␣parsing,␣so␣a␣paragraph 57s that␣ends␣with␣two␣or␣more␣spaces␣will␣not␣end␣with␣a␣hard␣line 57s break: 57s 57s  57s === expected =============== 57s aaa␣␣␣␣␣ 57s bbb␣␣␣␣␣ 57s  57s === got ==================== 57s 

Final␣spaces␣are␣stripped␣before␣inline␣parsing,␣so␣a␣paragraph 57s that␣ends␣with␣two␣or␣more␣spaces␣will␣not␣end␣with␣a␣hard␣line 57s break:

57s 57s Test #127 57s cross 57s === markdown =============== 57s  57s ##␣Blank␣lines 57s 57s [Blank␣lines](#blank-line)␣between␣block-level␣elements␣are␣ignored, 57s except␣for␣the␣role␣they␣play␣in␣determining␣whether␣a␣[list](#list) 57s is␣[tight](#tight)␣or␣[loose](#loose). 57s 57s Blank␣lines␣at␣the␣beginning␣and␣end␣of␣the␣document␣are␣also␣ignored. 57s 57s  57s === expected =============== 57s ␣␣ 57s 57s aaa 57s ␣␣ 57s 57s #␣aaa 57s 57s ␣␣ 57s  57s === got ==================== 57s 

Blank␣lines

57s

Blank␣lines␣between␣block-level␣elements␣are␣ignored, 57s except␣for␣the␣role␣they␣play␣in␣determining␣whether␣a␣list 57s is␣tight␣or␣loose.

57s

Blank␣lines␣at␣the␣beginning␣and␣end␣of␣the␣document␣are␣also␣ignored.

57s 57s Test #128 57s cross 57s === markdown =============== 57s  57s 57s #␣Container␣blocks 57s 57s A␣[container␣block](#container-block)␣is␣a␣block␣that␣has␣other 57s blocks␣as␣its␣contents.␣␣There␣are␣two␣basic␣kinds␣of␣container␣blocks: 57s [block␣quotes](#block-quote)␣and␣[list␣items](#list-item). 57s [Lists](#list)␣are␣meta-containers␣for␣[list␣items](#list-item). 57s 57s We␣define␣the␣syntax␣for␣container␣blocks␣recursively.␣␣The␣general 57s form␣of␣the␣definition␣is: 57s 57s >␣If␣X␣is␣a␣sequence␣of␣blocks,␣then␣the␣result␣of 57s >␣transforming␣X␣in␣such-and-such␣a␣way␣is␣a␣container␣of␣type␣Y 57s >␣with␣these␣blocks␣as␣its␣content. 57s 57s So,␣we␣explain␣what␣counts␣as␣a␣block␣quote␣or␣list␣item␣by␣explaining 57s how␣these␣can␣be␣*generated*␣from␣their␣contents.␣This␣should␣suffice 57s to␣define␣the␣syntax,␣although␣it␣does␣not␣give␣a␣recipe␣for␣*parsing* 57s these␣constructions.␣␣(A␣recipe␣is␣provided␣below␣in␣the␣section␣entitled 57s [A␣parsing␣strategy](#appendix-a-a-parsing-strategy).) 57s 57s ##␣Block␣quotes 57s 57s A␣[block␣quote␣marker](#block-quote-marker)␣ 57s consists␣of␣0-3␣spaces␣of␣initial␣indent,␣plus␣(a)␣the␣character␣`>`␣together 57s with␣a␣following␣space,␣or␣(b)␣a␣single␣character␣`>`␣not␣followed␣by␣a␣space. 57s 57s The␣following␣rules␣define␣[block␣quotes](#block-quote): 57s 57s 57s 1.␣␣**Basic␣case.**␣␣If␣a␣string␣of␣lines␣*Ls*␣constitute␣a␣sequence 57s ␣␣␣␣of␣blocks␣*Bs*,␣then␣the␣result␣of␣appending␣a␣[block␣quote 57s ␣␣␣␣marker](#block-quote-marker)␣to␣the␣beginning␣of␣each␣line␣in␣*Ls* 57s ␣␣␣␣is␣a␣[block␣quote](#block-quote)␣containing␣*Bs*. 57s 57s 2.␣␣**Laziness.**␣␣If␣a␣string␣of␣lines␣*Ls*␣constitute␣a␣[block 57s ␣␣␣␣quote](#block-quote)␣with␣contents␣*Bs*,␣then␣the␣result␣of␣deleting 57s ␣␣␣␣the␣initial␣[block␣quote␣marker](#block-quote-marker)␣from␣one␣or 57s ␣␣␣␣more␣lines␣in␣which␣the␣next␣non-space␣character␣after␣the␣[block 57s ␣␣␣␣quote␣marker](#block-quote-marker)␣is␣[paragraph␣continuation 57s ␣␣␣␣text](#paragraph-continuation-text)␣is␣a␣block␣quote␣with␣*Bs*␣as 57s ␣␣␣␣its␣content.␣␣ 57s ␣␣␣␣[Paragraph␣continuation␣text](#paragraph-continuation-text)␣is␣text 57s ␣␣␣␣that␣will␣be␣parsed␣as␣part␣of␣the␣content␣of␣a␣paragraph,␣but␣does 57s ␣␣␣␣not␣occur␣at␣the␣beginning␣of␣the␣paragraph. 57s 57s 3.␣␣**Consecutiveness.**␣␣A␣document␣cannot␣contain␣two␣[block 57s ␣␣␣␣quotes](#block-quote)␣in␣a␣row␣unless␣there␣is␣a␣[blank 57s ␣␣␣␣line](#blank-line)␣between␣them. 57s 57s Nothing␣else␣counts␣as␣a␣[block␣quote](#block-quote). 57s 57s Here␣is␣a␣simple␣example: 57s 57s  57s === expected =============== 57s >␣#␣Foo 57s >␣bar 57s >␣baz 57s  57s === got ==================== 57s 

Container␣blocks

57s

A␣container␣block␣is␣a␣block␣that␣has␣other 57s blocks␣as␣its␣contents.␣␣There␣are␣two␣basic␣kinds␣of␣container␣blocks: 57s block␣quotes␣and␣list␣items. 57s Lists␣are␣meta-containers␣for␣list␣items.

57s

We␣define␣the␣syntax␣for␣container␣blocks␣recursively.␣␣The␣general 57s form␣of␣the␣definition␣is:

57s
57s

If␣X␣is␣a␣sequence␣of␣blocks,␣then␣the␣result␣of 57s transforming␣X␣in␣such-and-such␣a␣way␣is␣a␣container␣of␣type␣Y 57s with␣these␣blocks␣as␣its␣content.

57s
57s

So,␣we␣explain␣what␣counts␣as␣a␣block␣quote␣or␣list␣item␣by␣explaining 57s how␣these␣can␣be␣generated␣from␣their␣contents.␣This␣should␣suffice 57s to␣define␣the␣syntax,␣although␣it␣does␣not␣give␣a␣recipe␣for␣parsing 57s these␣constructions.␣␣(A␣recipe␣is␣provided␣below␣in␣the␣section␣entitled 57s A␣parsing␣strategy.)

57s

Block␣quotes

57s

A␣block␣quote␣marker␣ 57s consists␣of␣0-3␣spaces␣of␣initial␣indent,␣plus␣(a)␣the␣character␣>␣together 57s with␣a␣following␣space,␣or␣(b)␣a␣single␣character␣>␣not␣followed␣by␣a␣space.

57s

The␣following␣rules␣define␣block␣quotes: 57s

57s
    57s
  1. Basic␣case.␣␣If␣a␣string␣of␣lines␣Ls␣constitute␣a␣sequence 57s of␣blocks␣Bs,␣then␣the␣result␣of␣appending␣a␣block␣quote 57s marker␣to␣the␣beginning␣of␣each␣line␣in␣Ls 57s is␣a␣block␣quote␣containing␣Bs.

  2. 57s
  3. Laziness.␣␣If␣a␣string␣of␣lines␣Ls␣constitute␣a␣block 57s quote␣with␣contents␣Bs,␣then␣the␣result␣of␣deleting 57s the␣initial␣block␣quote␣marker␣from␣one␣or 57s more␣lines␣in␣which␣the␣next␣non-space␣character␣after␣the␣block 57s quote␣marker␣is␣paragraph␣continuation 57s text␣is␣a␣block␣quote␣with␣Bs␣as 57s its␣content.␣␣ 57s Paragraph␣continuation␣text␣is␣text 57s that␣will␣be␣parsed␣as␣part␣of␣the␣content␣of␣a␣paragraph,␣but␣does 57s not␣occur␣at␣the␣beginning␣of␣the␣paragraph.

  4. 57s
  5. Consecutiveness.␣␣A␣document␣cannot␣contain␣two␣block 57s quotes␣in␣a␣row␣unless␣there␣is␣a␣blank 57s line␣between␣them.

  6. 57s
57s

Nothing␣else␣counts␣as␣a␣block␣quote.

57s

Here␣is␣a␣simple␣example:

57s 57s Test #129 57s cross 57s === markdown =============== 57s  57s The␣spaces␣after␣the␣`>`␣characters␣can␣be␣omitted: 57s 57s  57s === expected =============== 57s >#␣Foo 57s >bar 57s >␣baz 57s  57s === got ==================== 57s 

The␣spaces␣after␣the␣>␣characters␣can␣be␣omitted:

57s 57s Test #130 57s cross 57s === markdown =============== 57s  57s The␣`>`␣characters␣can␣be␣indented␣1-3␣spaces: 57s 57s  57s === expected =============== 57s ␣␣␣>␣#␣Foo 57s ␣␣␣>␣bar 57s ␣>␣baz 57s  57s === got ==================== 57s 

The␣>␣characters␣can␣be␣indented␣1-3␣spaces:

57s 57s Test #131 57s cross 57s === markdown =============== 57s  57s Four␣spaces␣gives␣us␣a␣code␣block: 57s 57s  57s === expected =============== 57s ␣␣␣␣>␣#␣Foo 57s ␣␣␣␣>␣bar 57s ␣␣␣␣>␣baz 57s  57s === got ==================== 57s 

Four␣spaces␣gives␣us␣a␣code␣block:

57s 57s Test #132 57s cross 57s === markdown =============== 57s  57s The␣Laziness␣clause␣allows␣us␣to␣omit␣the␣`>`␣before␣a 57s paragraph␣continuation␣line: 57s 57s  57s === expected =============== 57s >␣#␣Foo 57s >␣bar 57s baz 57s  57s === got ==================== 57s 

The␣Laziness␣clause␣allows␣us␣to␣omit␣the␣>␣before␣a 57s paragraph␣continuation␣line:

57s 57s Test #133 57s cross 57s === markdown =============== 57s  57s A␣block␣quote␣can␣contain␣some␣lazy␣and␣some␣non-lazy 57s continuation␣lines: 57s 57s  57s === expected =============== 57s >␣bar 57s baz 57s >␣foo 57s  57s === got ==================== 57s 

A␣block␣quote␣can␣contain␣some␣lazy␣and␣some␣non-lazy 57s continuation␣lines:

57s 57s Test #134 57s cross 57s === markdown =============== 57s  57s Laziness␣only␣applies␣to␣lines␣that␣are␣continuations␣of 57s paragraphs.␣Lines␣containing␣characters␣or␣indentation␣that␣indicate 57s block␣structure␣cannot␣be␣lazy. 57s 57s  57s === expected =============== 57s >␣foo 57s --- 57s  57s === got ==================== 57s 

Laziness␣only␣applies␣to␣lines␣that␣are␣continuations␣of 57s paragraphs.␣Lines␣containing␣characters␣or␣indentation␣that␣indicate 57s block␣structure␣cannot␣be␣lazy.

57s 57s Test #135 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s >␣-␣foo 57s -␣bar 57s  57s === got ==================== 57s  57s Test #136 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s >␣␣␣␣␣foo 57s ␣␣␣␣bar 57s  57s === got ==================== 57s  57s Test #137 57s cross 57s === markdown =============== 57s  57s  57s === expected =============== 57s >␣``` 57s foo 57s ``` 57s  57s === got ==================== 57s  57s Test #138 57s cross 57s === markdown =============== 57s  57s A␣block␣quote␣can␣be␣empty: 57s 57s  57s === expected =============== 57s  57s === got ==================== 57s 

A␣block␣quote␣can␣be␣empty:

57s 57s Test #139 57s cross 57s === markdown =============== 57s 
57s
57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
57s
57s 57s Test #140 57s cross 57s === markdown =============== 57s 
57s
57s  57s === expected =============== 57s  57s A␣block␣quote␣can␣have␣initial␣or␣final␣blank␣lines: 57s 57s  57s === got ==================== 57s 
57s
57s 57s Test #141 57s cross 57s === markdown =============== 57s 
57s

foo

57s
57s  57s === expected =============== 57s  57s A␣blank␣line␣always␣separates␣block␣quotes: 57s 57s  57s === got ==================== 57s 
57s

foo

57s
57s 57s Test #142 57s cross 57s === markdown =============== 57s 
57s

foo

57s
57s
57s

bar

57s
57s  57s === expected =============== 57s  57s (Most␣current␣Markdown␣implementations,␣including␣John␣Gruber's 57s original␣`Markdown.pl`,␣will␣parse␣this␣example␣as␣a␣single␣block␣quote 57s with␣two␣paragraphs.␣␣But␣it␣seems␣better␣to␣allow␣the␣author␣to␣decide 57s whether␣two␣block␣quotes␣or␣one␣are␣wanted.) 57s 57s Consecutiveness␣means␣that␣if␣we␣put␣these␣block␣quotes␣together, 57s we␣get␣a␣single␣block␣quote: 57s 57s  57s === got ==================== 57s 
57s

foo

57s
57s
57s

bar

57s
57s 57s Test #143 57s cross 57s === markdown =============== 57s 
57s

foo 57s bar

57s
57s  57s === expected =============== 57s  57s To␣get␣a␣block␣quote␣with␣two␣paragraphs,␣use: 57s 57s  57s === got ==================== 57s 
57s

foo 57s bar

57s
57s 57s Test #144 57s cross 57s === markdown =============== 57s 
57s

foo

57s

bar

57s
57s  57s === expected =============== 57s  57s Block␣quotes␣can␣interrupt␣paragraphs: 57s 57s  57s === got ==================== 57s 
57s

foo

57s

bar

57s
57s 57s Test #145 57s cross 57s === markdown =============== 57s 

foo

57s
57s

bar

57s
57s  57s === expected =============== 57s  57s In␣general,␣blank␣lines␣are␣not␣needed␣before␣or␣after␣block 57s quotes: 57s 57s  57s === got ==================== 57s 

foo

57s
57s

bar

57s
57s 57s Test #146 57s cross 57s === markdown =============== 57s 
57s

aaa

57s
57s 57s
57s

bbb

57s
57s  57s === expected =============== 57s  57s However,␣because␣of␣laziness,␣a␣blank␣line␣is␣needed␣between 57s a␣block␣quote␣and␣a␣following␣paragraph: 57s 57s  57s === got ==================== 57s 
57s

aaa

57s
57s 57s
57s

bbb

57s
57s 57s Test #147 57s cross 57s === markdown =============== 57s 
57s

bar 57s baz

57s
57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
57s

bar 57s baz

57s
57s 57s Test #148 57s cross 57s === markdown =============== 57s 
57s

bar

57s
57s

baz

57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
57s

bar

57s
57s

baz

57s 57s Test #149 57s cross 57s === markdown =============== 57s 
57s

bar

57s
57s

baz

57s  57s === expected =============== 57s  57s It␣is␣a␣consequence␣of␣the␣Laziness␣rule␣that␣any␣number 57s of␣initial␣`>`s␣may␣be␣omitted␣on␣a␣continuation␣line␣of␣a 57s nested␣block␣quote: 57s 57s  57s === got ==================== 57s 
57s

bar

57s
57s

baz

57s 57s Test #150 57s cross 57s === markdown =============== 57s 
57s
57s
57s

foo 57s bar

57s
57s
57s
57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
57s
57s
57s

foo 57s bar

57s
57s
57s
57s 57s Test #151 57s cross 57s === markdown =============== 57s 
57s
57s
57s

foo 57s bar 57s baz

57s
57s
57s
57s  57s === expected =============== 57s  57s When␣including␣an␣indented␣code␣block␣in␣a␣block␣quote, 57s remember␣that␣the␣[block␣quote␣marker](#block-quote-marker)␣includes 57s both␣the␣`>`␣and␣a␣following␣space.␣␣So␣*five␣spaces*␣are␣needed␣after 57s the␣`>`: 57s 57s  57s === got ==================== 57s 
57s
57s
57s

foo 57s bar 57s baz

57s
57s
57s
57s 57s Test #152 57s cross 57s === markdown =============== 57s 
57s
code
 57s 
57s
57s
57s

not␣code

57s
57s  57s === expected =============== 57s  57s 57s ##␣List␣items 57s 57s A␣[list␣marker](#list-marker)␣␣is␣a 57s [bullet␣list␣marker](#bullet-list-marker)␣or␣an␣[ordered␣list 57s marker](#ordered-list-marker). 57s 57s A␣[bullet␣list␣marker](#bullet-list-marker)␣ 57s is␣a␣`-`,␣`+`,␣or␣`*`␣character. 57s 57s An␣[ordered␣list␣marker](#ordered-list-marker)␣ 57s is␣a␣sequence␣of␣one␣of␣more␣digits␣(`0-9`),␣followed␣by␣either␣a 57s `.`␣character␣or␣a␣`)`␣character. 57s 57s The␣following␣rules␣define␣[list␣items](#list-item): 57s 57s 1.␣␣**Basic␣case.**␣␣If␣a␣sequence␣of␣lines␣*Ls*␣constitute␣a␣sequence␣of 57s ␣␣␣␣blocks␣*Bs*␣starting␣with␣a␣non-space␣character␣and␣not␣separated 57s ␣␣␣␣from␣each␣other␣by␣more␣than␣one␣blank␣line,␣and␣*M*␣is␣a␣list 57s ␣␣␣␣marker␣*M*␣of␣width␣*W*␣followed␣by␣0␣<␣*N*␣<␣5␣spaces,␣then␣the␣result 57s ␣␣␣␣of␣prepending␣*M*␣and␣the␣following␣spaces␣to␣the␣first␣line␣of 57s ␣␣␣␣*Ls*,␣and␣indenting␣subsequent␣lines␣of␣*Ls*␣by␣*W␣+␣N*␣spaces,␣is␣a 57s ␣␣␣␣list␣item␣with␣*Bs*␣as␣its␣contents.␣␣The␣type␣of␣the␣list␣item 57s ␣␣␣␣(bullet␣or␣ordered)␣is␣determined␣by␣the␣type␣of␣its␣list␣marker. 57s ␣␣␣␣If␣the␣list␣item␣is␣ordered,␣then␣it␣is␣also␣assigned␣a␣start 57s ␣␣␣␣number,␣based␣on␣the␣ordered␣list␣marker. 57s 57s For␣example,␣let␣*Ls*␣be␣the␣lines 57s 57s  57s === got ==================== 57s 
57s
code
 57s 
57s
57s
57s

not␣code

57s
57s 57s Test #153 57s cross 57s === markdown =============== 57s 

A␣paragraph 57s with␣two␣lines.

57s
indented␣code
 57s 
57s
57s

A␣block␣quote.

57s
57s  57s === expected =============== 57s  57s And␣let␣*M*␣be␣the␣marker␣`1.`,␣and␣*N*␣=␣2.␣␣Then␣rule␣#1␣says 57s that␣the␣following␣is␣an␣ordered␣list␣item␣with␣start␣number␣1, 57s and␣the␣same␣contents␣as␣*Ls*: 57s 57s  57s === got ==================== 57s 

A␣paragraph 57s with␣two␣lines.

57s
indented␣code
 57s 
57s
57s

A␣block␣quote.

57s
57s 57s Test #154 57s cross 57s === markdown =============== 57s 
    57s
  1. A␣paragraph 57s with␣two␣lines.

    57s
    indented␣code
     57s 
    57s
    57s

    A␣block␣quote.

    57s
  2. 57s
57s  57s === expected =============== 57s  57s The␣most␣important␣thing␣to␣notice␣is␣that␣the␣position␣of 57s the␣text␣after␣the␣list␣marker␣determines␣how␣much␣indentation 57s is␣needed␣in␣subsequent␣blocks␣in␣the␣list␣item.␣␣If␣the␣list 57s marker␣takes␣up␣two␣spaces,␣and␣there␣are␣three␣spaces␣between 57s the␣list␣marker␣and␣the␣next␣nonspace␣character,␣then␣blocks 57s must␣be␣indented␣five␣spaces␣in␣order␣to␣fall␣under␣the␣list 57s item. 57s 57s Here␣are␣some␣examples␣showing␣how␣far␣content␣must␣be␣indented␣to␣be 57s put␣under␣the␣list␣item: 57s 57s  57s === got ==================== 57s 
    57s
  1. A␣paragraph 57s with␣two␣lines.

    57s
    indented␣code
     57s 
    57s
    57s

    A␣block␣quote.

    57s
  2. 57s
57s 57s Test #155 57s cross 57s === markdown =============== 57s 
    57s
  • one
  • 57s
57s

two

57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
    57s
  • one
  • 57s
57s

two

57s 57s Test #156 57s cross 57s === markdown =============== 57s 
    57s
  • one

    57s

    two

  • 57s
57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
    57s
  • one

    57s

    two

  • 57s
57s 57s Test #157 57s cross 57s === markdown =============== 57s 
    57s
  • one
  • 57s
57s
␣two
 57s 
57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
    57s
  • one
  • 57s
57s
␣two
 57s 
57s 57s Test #158 57s cross 57s === markdown =============== 57s 
    57s
  • one

    57s

    two

  • 57s
57s  57s === expected =============== 57s  57s It␣is␣tempting␣to␣think␣of␣this␣in␣terms␣of␣columns:␣␣the␣continuation 57s blocks␣must␣be␣indented␣at␣least␣to␣the␣column␣of␣the␣first␣nonspace 57s character␣after␣the␣list␣marker.␣␣However,␣that␣is␣not␣quite␣right. 57s The␣spaces␣after␣the␣list␣marker␣determine␣how␣much␣relative␣indentation 57s is␣needed.␣␣Which␣column␣this␣indentation␣reaches␣will␣depend␣on 57s how␣the␣list␣item␣is␣embedded␣in␣other␣constructions,␣as␣shown␣by 57s this␣example: 57s 57s  57s === got ==================== 57s 
    57s
  • one

    57s

    two

  • 57s
57s 57s Test #159 57s cross 57s === markdown =============== 57s 
57s
57s
    57s
  1. one

    57s

    two

  2. 57s
57s
57s
57s  57s === expected =============== 57s  57s Here␣`two`␣occurs␣in␣the␣same␣column␣as␣the␣list␣marker␣`1.`, 57s but␣is␣actually␣contained␣in␣the␣list␣item,␣because␣there␣is 57s sufficent␣indentation␣after␣the␣last␣containing␣blockquote␣marker. 57s 57s The␣converse␣is␣also␣possible.␣␣In␣the␣following␣example,␣the␣word␣`two` 57s occurs␣far␣to␣the␣right␣of␣the␣initial␣text␣of␣the␣list␣item,␣`one`,␣but 57s it␣is␣not␣considered␣part␣of␣the␣list␣item,␣because␣it␣is␣not␣indented 57s far␣enough␣past␣the␣blockquote␣marker: 57s 57s  57s === got ==================== 57s 
57s
57s
    57s
  1. one

    57s

    two

  2. 57s
57s
57s
57s 57s Test #160 57s cross 57s === markdown =============== 57s 
57s
57s
    57s
  • one
  • 57s
57s

two

57s
57s
57s  57s === expected =============== 57s  57s A␣list␣item␣may␣not␣contain␣blocks␣that␣are␣separated␣by␣more␣than 57s one␣blank␣line.␣␣Thus,␣two␣blank␣lines␣will␣end␣a␣list,␣unless␣the 57s two␣blanks␣are␣contained␣in␣a␣[fenced␣code␣block](#fenced-code-block). 57s 57s  57s === got ==================== 57s 
57s
57s
    57s
  • one
  • 57s
57s

two

57s
57s
57s 57s Test #161 57s cross 57s === markdown =============== 57s 
    57s
  • foo

    57s

    bar

  • 57s
  • foo

  • 57s
57s

bar

57s
    57s
  • foo
     57s 
     57s 
     57s bar
     57s 
  • 57s
57s  57s === expected =============== 57s  57s A␣list␣item␣may␣contain␣any␣kind␣of␣block: 57s 57s  57s === got ==================== 57s 
    57s
  • foo

    57s

    bar

  • 57s
  • foo

  • 57s
57s

bar

57s
    57s
  • foo
     57s 

    bar 57s

  • 57s
57s 57s Test #162 57s cross 57s === markdown =============== 57s 
    57s
  1. foo

    57s
    bar
     57s 
    57s

    baz

    57s
    57s

    bam

    57s
  2. 57s
57s  57s === expected =============== 57s  57s 2.␣␣**Item␣starting␣with␣indented␣code.**␣␣If␣a␣sequence␣of␣lines␣*Ls* 57s ␣␣␣␣constitute␣a␣sequence␣of␣blocks␣*Bs*␣starting␣with␣an␣indented␣code 57s ␣␣␣␣block␣and␣not␣separated␣from␣each␣other␣by␣more␣than␣one␣blank␣line, 57s ␣␣␣␣and␣*M*␣is␣a␣list␣marker␣*M*␣of␣width␣*W*␣followed␣by 57s ␣␣␣␣one␣space,␣then␣the␣result␣of␣prepending␣*M*␣and␣the␣following 57s ␣␣␣␣space␣to␣the␣first␣line␣of␣*Ls*,␣and␣indenting␣subsequent␣lines␣of 57s ␣␣␣␣*Ls*␣by␣*W␣+␣1*␣spaces,␣is␣a␣list␣item␣with␣*Bs*␣as␣its␣contents. 57s ␣␣␣␣If␣a␣line␣is␣empty,␣then␣it␣need␣not␣be␣indented.␣␣The␣type␣of␣the 57s ␣␣␣␣list␣item␣(bullet␣or␣ordered)␣is␣determined␣by␣the␣type␣of␣its␣list 57s ␣␣␣␣marker.␣␣If␣the␣list␣item␣is␣ordered,␣then␣it␣is␣also␣assigned␣a 57s ␣␣␣␣start␣number,␣based␣on␣the␣ordered␣list␣marker. 57s 57s An␣indented␣code␣block␣will␣have␣to␣be␣indented␣four␣spaces␣beyond 57s the␣edge␣of␣the␣region␣where␣text␣will␣be␣included␣in␣the␣list␣item. 57s In␣the␣following␣case␣that␣is␣6␣spaces: 57s 57s  57s === got ==================== 57s 
    57s
  1. foo

    57s
    bar
     57s 
    57s

    baz

    57s
    57s

    bam

    57s
  2. 57s
57s 57s Test #163 57s cross 57s === markdown =============== 57s 
    57s
  • foo

    57s
    bar
     57s 
  • 57s
57s  57s === expected =============== 57s  57s And␣in␣this␣case␣it␣is␣11␣spaces: 57s 57s  57s === got ==================== 57s 
    57s
  • foo

    57s
    bar
     57s 
  • 57s
57s 57s Test #164 57s cross 57s === markdown =============== 57s  57s
  • foo

    57s
    bar
     57s 
  • 57s 57s  57s === expected =============== 57s  57s If␣the␣*first*␣block␣in␣the␣list␣item␣is␣an␣indented␣code␣block, 57s then␣by␣rule␣#2,␣the␣contents␣must␣be␣indented␣*one*␣space␣after␣the 57s list␣marker: 57s 57s  57s === got ==================== 57s  57s
  • foo

    57s
    bar
     57s 
  • 57s 57s 57s Test #165 57s cross 57s === markdown =============== 57s 
    indented␣code
     57s 
    57s

    paragraph

    57s
    more␣code
     57s 
    57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
    indented␣code
     57s 
    57s

    paragraph

    57s
    more␣code
     57s 
    57s 57s Test #166 57s cross 57s === markdown =============== 57s 
      57s
    1. indented␣code
       57s 
      57s

      paragraph

      57s
      more␣code
       57s 
    2. 57s
    57s  57s === expected =============== 57s  57s Note␣that␣an␣additional␣space␣indent␣is␣interpreted␣as␣space 57s inside␣the␣code␣block: 57s 57s  57s === got ==================== 57s 
      57s
    1. indented␣code
       57s 
      57s

      paragraph

      57s
      more␣code
       57s 
    2. 57s
    57s 57s Test #167 57s cross 57s === markdown =============== 57s 
      57s
    1. ␣indented␣code
       57s 
      57s

      paragraph

      57s
      more␣code
       57s 
    2. 57s
    57s  57s === expected =============== 57s  57s Note␣that␣rules␣#1␣and␣#2␣only␣apply␣to␣two␣cases:␣␣(a)␣cases 57s in␣which␣the␣lines␣to␣be␣included␣in␣a␣list␣item␣begin␣with␣a␣nonspace 57s character,␣and␣(b)␣cases␣in␣which␣they␣begin␣with␣an␣indented␣code 57s block.␣␣In␣a␣case␣like␣the␣following,␣where␣the␣first␣block␣begins␣with 57s a␣three-space␣indent,␣the␣rules␣do␣not␣allow␣us␣to␣form␣a␣list␣item␣by 57s indenting␣the␣whole␣thing␣and␣prepending␣a␣list␣marker: 57s 57s  57s === got ==================== 57s 
      57s
    1. ␣indented␣code
       57s 
      57s

      paragraph

      57s
      more␣code
       57s 
    2. 57s
    57s 57s Test #168 57s cross 57s === markdown =============== 57s 

    foo

    57s

    bar

    57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 

    foo

    57s

    bar

    57s 57s Test #169 57s cross 57s === markdown =============== 57s 
      57s
    • foo
    • 57s
    57s

    bar

    57s  57s === expected =============== 57s  57s This␣is␣not␣a␣significant␣restriction,␣because␣when␣a␣block␣begins 57s with␣1-3␣spaces␣indent,␣the␣indentation␣can␣always␣be␣removed␣without 57s a␣change␣in␣interpretation,␣allowing␣rule␣#1␣to␣be␣applied.␣␣So,␣in 57s the␣above␣case: 57s 57s  57s === got ==================== 57s 
      57s
    • foo
    • 57s
    57s

    bar

    57s 57s Test #170 57s cross 57s === markdown =============== 57s 
      57s
    • foo

      57s

      bar

    • 57s
    57s  57s === expected =============== 57s  57s 57s 3.␣␣**Indentation.**␣␣If␣a␣sequence␣of␣lines␣*Ls*␣constitutes␣a␣list␣item 57s ␣␣␣␣according␣to␣rule␣#1␣or␣#2,␣then␣the␣result␣of␣indenting␣each␣line 57s ␣␣␣␣of␣*L*␣by␣1-3␣spaces␣(the␣same␣for␣each␣line)␣also␣constitutes␣a 57s ␣␣␣␣list␣item␣with␣the␣same␣contents␣and␣attributes.␣␣If␣a␣line␣is 57s ␣␣␣␣empty,␣then␣it␣need␣not␣be␣indented. 57s 57s Indented␣one␣space: 57s 57s  57s === got ==================== 57s 
      57s
    • foo

      57s

      bar

    • 57s
    57s 57s Test #171 57s cross 57s === markdown =============== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s  57s === expected =============== 57s  57s Indented␣two␣spaces: 57s 57s  57s === got ==================== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s 57s Test #172 57s cross 57s === markdown =============== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s  57s === expected =============== 57s  57s Indented␣three␣spaces: 57s 57s  57s === got ==================== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s 57s Test #173 57s cross 57s === markdown =============== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s  57s === expected =============== 57s  57s Four␣spaces␣indent␣gives␣a␣code␣block: 57s 57s  57s === got ==================== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s 57s Test #174 57s cross 57s === markdown =============== 57s 
    1.␣␣A␣paragraph
     57s ␣␣␣␣with␣two␣lines.
     57s 
     57s ␣␣␣␣␣␣␣␣indented␣code
     57s 
     57s ␣␣␣␣>␣A␣block␣quote.
     57s 
    57s  57s === expected =============== 57s  57s 57s 4.␣␣**Laziness.**␣␣If␣a␣string␣of␣lines␣*Ls*␣constitute␣a␣[list 57s ␣␣␣␣item](#list-item)␣with␣contents␣*Bs*,␣then␣the␣result␣of␣deleting 57s ␣␣␣␣some␣or␣all␣of␣the␣indentation␣from␣one␣or␣more␣lines␣in␣which␣the 57s ␣␣␣␣next␣non-space␣character␣after␣the␣indentation␣is 57s ␣␣␣␣[paragraph␣continuation␣text](#paragraph-continuation-text)␣is␣a 57s ␣␣␣␣list␣item␣with␣the␣same␣contents␣and␣attributes. 57s 57s Here␣is␣an␣example␣with␣lazy␣continuation␣lines: 57s 57s  57s === got ==================== 57s 
    1.␣␣A␣paragraph
     57s ␣␣␣␣with␣two␣lines.
     57s 
    ␣␣␣␣indented␣code
     57s 
     57s &gt;␣A␣block␣quote.
     57s 
    57s

    57s 57s Test #175 57s cross 57s === markdown =============== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s  57s === expected =============== 57s  57s Indentation␣can␣be␣partially␣deleted: 57s 57s  57s === got ==================== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.

      57s
      indented␣code
       57s 
      57s
      57s

      A␣block␣quote.

      57s
    2. 57s
    57s 57s Test #176 57s cross 57s === markdown =============== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.
    2. 57s
    57s  57s === expected =============== 57s  57s These␣examples␣show␣how␣laziness␣can␣work␣in␣nested␣structures: 57s 57s  57s === got ==================== 57s 
      57s
    1. A␣paragraph 57s with␣two␣lines.
    2. 57s
    57s 57s Test #177 57s cross 57s === markdown =============== 57s 
    57s
      57s
    1. 57s

      Blockquote 57s continued␣here.

      57s
    2. 57s
    57s
    57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
    57s
      57s
    1. 57s

      Blockquote 57s continued␣here.

      57s
    2. 57s
    57s
    57s 57s Test #178 57s cross 57s === markdown =============== 57s 
    57s
      57s
    1. 57s

      Blockquote 57s continued␣here.

      57s
    2. 57s
    57s
    57s  57s === expected =============== 57s  57s 57s 5.␣␣**That's␣all.**␣Nothing␣that␣is␣not␣counted␣as␣a␣list␣item␣by␣rules 57s ␣␣␣␣#1--4␣counts␣as␣a␣[list␣item](#list-item). 57s 57s The␣rules␣for␣sublists␣follow␣from␣the␣general␣rules␣above.␣␣A␣sublist 57s must␣be␣indented␣the␣same␣number␣of␣spaces␣a␣paragraph␣would␣need␣to␣be 57s in␣order␣to␣be␣included␣in␣the␣list␣item. 57s 57s So,␣in␣this␣case␣we␣need␣two␣spaces␣indent: 57s 57s  57s === got ==================== 57s 
    57s
      57s
    1. 57s

      Blockquote 57s continued␣here.

      57s
    2. 57s
    57s
    57s 57s Test #179 57s cross 57s === markdown =============== 57s 
      57s
    • foo 57s
        57s
      • bar 57s
          57s
        • baz
        • 57s
      • 57s
    • 57s
    57s  57s === expected =============== 57s  57s One␣is␣not␣enough: 57s 57s  57s === got ==================== 57s 
      57s
    • foo 57s
        57s
      • bar 57s
          57s
        • baz
        • 57s
      • 57s
    • 57s
    57s 57s Test #180 57s cross 57s === markdown =============== 57s 
      57s
    • foo
    • 57s
    • bar
    • 57s
    • baz
    • 57s
    57s  57s === expected =============== 57s  57s Here␣we␣need␣four,␣because␣the␣list␣marker␣is␣wider: 57s 57s  57s === got ==================== 57s 
      57s
    • foo
    • 57s
    • bar
    • 57s
    • baz
    • 57s
    57s 57s Test #181 57s cross 57s === markdown =============== 57s  57s
  • foo 57s
      57s
    • bar
    • 57s
  • 57s 57s  57s === expected =============== 57s  57s Three␣is␣not␣enough: 57s 57s  57s === got ==================== 57s  57s
  • foo 57s
      57s
    • bar
    • 57s
  • 57s 57s 57s Test #182 57s cross 57s === markdown =============== 57s  57s
  • foo
  • 57s 57s
      57s
    • bar
    • 57s
    57s  57s === expected =============== 57s  57s A␣list␣may␣be␣the␣first␣block␣in␣a␣list␣item: 57s 57s  57s === got ==================== 57s  57s
  • foo
  • 57s 57s
      57s
    • bar
    • 57s
    57s 57s Test #183 57s cross 57s === markdown =============== 57s 
      57s
      • 57s
      • foo
      • 57s
    • 57s
    57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
      57s
      • 57s
      • foo
      • 57s
    • 57s
    57s 57s Test #184 57s cross 57s === markdown =============== 57s 
      57s
      • 57s
      • 57s
      • foo
      • 57s
    57s 57s 57s  57s === expected =============== 57s  57s A␣list␣item␣may␣be␣empty: 57s 57s  57s === got ==================== 57s 
      57s
      • 57s
      • 57s
      • foo
      • 57s
    57s 57s 57s 57s Test #185 57s cross 57s === markdown =============== 57s 
      57s
    • foo
    • 57s
    • 57s
    • bar
    • 57s
    57s  57s === expected =============== 57s  57s  57s === got ==================== 57s 
      57s
    • foo
    • 57s
    • 57s
    • bar
    • 57s
    57s 57s Test #186 57s cross 57s === markdown =============== 57s 
      57s
    • 57s
    57s  57s === expected =============== 57s  57s ###␣Motivation 57s 57s John␣Gruber's␣Markdown␣spec␣says␣the␣following␣about␣list␣items: 57s 57s 1.␣"List␣markers␣typically␣start␣at␣the␣left␣margin,␣but␣may␣be␣indented 57s ␣␣␣by␣up␣to␣three␣spaces.␣List␣markers␣must␣be␣followed␣by␣one␣or␣more 57s ␣␣␣spaces␣or␣a␣tab." 57s 57s 2.␣"To␣make␣lists␣look␣nice,␣you␣can␣wrap␣items␣with␣hanging␣indents.... 57s ␣␣␣But␣if␣you␣don't␣want␣to,␣you␣don't␣have␣to." 57s 57s 3.␣"List␣items␣may␣consist␣of␣multiple␣paragraphs.␣Each␣subsequent 57s ␣␣␣paragraph␣in␣a␣list␣item␣must␣be␣indented␣by␣either␣4␣spaces␣or␣one 57s ␣␣␣tab." 57s 57s 4.␣"It␣looks␣nice␣if␣you␣indent␣every␣line␣of␣the␣subsequent␣paragraphs, 57s ␣␣␣but␣here␣again,␣Markdown␣will␣allow␣you␣to␣be␣lazy." 57s 57s 5.␣"To␣put␣a␣blockquote␣within␣a␣list␣item,␣the␣blockquote's␣`>` 57s ␣␣␣delimiters␣need␣to␣be␣indented." 57s 57s 6.␣"To␣put␣a␣code␣block␣within␣a␣list␣item,␣the␣code␣block␣needs␣to␣be 57s ␣␣␣indented␣twice␣—␣8␣spaces␣or␣two␣tabs." 57s 57s These␣rules␣specify␣that␣a␣paragraph␣under␣a␣list␣item␣must␣be␣indented 57s four␣spaces␣(presumably,␣from␣the␣left␣margin,␣rather␣than␣the␣start␣of 57s the␣list␣marker,␣but␣this␣is␣not␣said),␣and␣that␣code␣under␣a␣list␣item 57s must␣be␣indented␣eight␣spaces␣instead␣of␣the␣usual␣four.␣␣They␣also␣say 57s that␣a␣block␣quote␣must␣be␣indented,␣but␣not␣by␣how␣much;␣however,␣the 57s example␣given␣has␣four␣spaces␣indentation.␣␣Although␣nothing␣is␣said 57s about␣other␣kinds␣of␣block-level␣content,␣it␣is␣certainly␣reasonable␣to 57s infer␣that␣*all*␣block␣elements␣under␣a␣list␣item,␣including␣other 57s lists,␣must␣be␣indented␣four␣spaces.␣␣This␣principle␣has␣been␣called␣the 57s *four-space␣rule*. 57s 57s The␣four-space␣rule␣is␣clear␣and␣principled,␣and␣if␣the␣reference 57s implementation␣`Markdown.pl`␣had␣followed␣it,␣it␣probably␣would␣have 57s become␣the␣standard.␣␣However,␣`Markdown.pl`␣allowed␣paragraphs␣and 57s sublists␣to␣start␣with␣only␣two␣spaces␣indentation,␣at␣least␣on␣the 57s outer␣level.␣␣Worse,␣its␣behavior␣was␣inconsistent:␣a␣sublist␣of␣an 57s outer-level␣list␣needed␣two␣spaces␣indentation,␣but␣a␣sublist␣of␣this 57s sublist␣needed␣three␣spaces.␣␣It␣is␣not␣surprising,␣then,␣that␣different 57s implementations␣of␣Markdown␣have␣developed␣very␣different␣rules␣for 57s determining␣what␣comes␣under␣a␣list␣item.␣␣(Pandoc␣and␣python-Markdown, 57s for␣example,␣stuck␣with␣Gruber's␣syntax␣description␣and␣the␣four-space 57s rule,␣while␣discount,␣redcarpet,␣marked,␣PHP␣Markdown,␣and␣others 57s followed␣`Markdown.pl`'s␣behavior␣more␣closely.) 57s 57s Unfortunately,␣given␣the␣divergences␣between␣implementations,␣there 57s is␣no␣way␣to␣give␣a␣spec␣for␣list␣items␣that␣will␣be␣guaranteed␣not 57s to␣break␣any␣existing␣documents.␣␣However,␣the␣spec␣given␣here␣should 57s correctly␣handle␣lists␣formatted␣with␣either␣the␣four-space␣rule␣or 57s the␣more␣forgiving␣`Markdown.pl`␣behavior,␣provided␣they␣are␣laid␣out 57s in␣a␣way␣that␣is␣natural␣for␣a␣human␣to␣read. 57s 57s The␣strategy␣here␣is␣to␣let␣the␣width␣and␣indentation␣of␣the␣list␣marker 57s determine␣the␣indentation␣necessary␣for␣blocks␣to␣fall␣under␣the␣list 57s item,␣rather␣than␣having␣a␣fixed␣and␣arbitrary␣number.␣␣The␣writer␣can 57s think␣of␣the␣body␣of␣the␣list␣item␣as␣a␣unit␣which␣gets␣indented␣to␣the 57s right␣enough␣to␣fit␣the␣list␣marker␣(and␣any␣indentation␣on␣the␣list 57s marker).␣␣(The␣laziness␣rule,␣#4,␣then␣allows␣continuation␣lines␣to␣be 57s unindented␣if␣needed.) 57s 57s This␣rule␣is␣superior,␣we␣claim,␣to␣any␣rule␣requiring␣a␣fixed␣level␣of 57s indentation␣from␣the␣margin.␣␣The␣four-space␣rule␣is␣clear␣but 57s unnatural.␣It␣is␣quite␣unintuitive␣that 57s 57s ```␣markdown 57s -␣foo 57s 57s ␣␣bar 57s 57s ␣␣-␣baz 57s ``` 57s 57s should␣be␣parsed␣as␣two␣lists␣with␣an␣intervening␣paragraph, 57s 57s ```␣html 57s
      57s
    • foo
    • 57s
    57s

    bar

    57s
      57s
    • baz
    • 57s
    57s ``` 57s 57s as␣the␣four-space␣rule␣demands,␣rather␣than␣a␣single␣list, 57s 57s ```␣html 57s
      57s
    • foo

      57s

      bar

      57s
        57s
      • baz
      • 57s
    • 57s
    57s ``` 57s 57s The␣choice␣of␣four␣spaces␣is␣arbitrary.␣␣It␣can␣be␣learned,␣but␣it␣is 57s not␣likely␣to␣be␣guessed,␣and␣it␣trips␣up␣beginners␣regularly. 57s 57s Would␣it␣help␣to␣adopt␣a␣two-space␣rule?␣␣The␣problem␣is␣that␣such 57s a␣rule,␣together␣with␣the␣rule␣allowing␣1--3␣spaces␣indentation␣of␣the 57s initial␣list␣marker,␣allows␣text␣that␣is␣indented␣*less␣than*␣the 57s original␣list␣marker␣to␣be␣included␣in␣the␣list␣item.␣For␣example, 57s `Markdown.pl`␣parses 57s 57s ```␣markdown 57s ␣␣␣-␣one 57s 57s ␣␣two 57s ``` 57s 57s as␣a␣single␣list␣item,␣with␣`two`␣a␣continuation␣paragraph: 57s 57s ```␣html 57s
      57s
    • one

      57s

      two

    • 57s
    57s ``` 57s 57s and␣similarly 57s 57s ```␣markdown 57s >␣␣␣-␣one 57s  57s === got ==================== 57s 
      57s
    • 57s
    57s 57s [Lists] 57s Test #187 57s tick 57s Test #188 57s tick 57s Test #189 57s tick 57s Test #190 57s tick 57s Test #191 57s tick 57s Test #192 57s tick 57s Test #193 57s tick 57s Test #194 57s tick 57s Test #195 57s tick 57s Test #196 57s tick 57s Test #197 57s tick 57s Test #198 57s tick 57s Test #199 57s tick 57s Test #200 57s tick 57s Test #201 57s tick 57s Test #202 57s tick 57s Test #203 57s tick 57s Test #204 57s tick 57s Test #205 57s tick 57s Test #206 57s tick 57s [Inlines] 57s Test #207 57s tick 57s [Backslash escapes] 57s Test #208 57s tick 57s Test #209 57s tick 57s Test #210 57s tick 57s Test #211 57s tick 57s Test #212 57s tick 57s Test #213 57s tick 57s Test #214 57s tick 57s Test #215 57s tick 57s Test #216 57s tick 57s Test #217 57s tick 57s Test #218 57s tick 57s Test #219 57s tick 57s Test #220 57s tick 57s [Entities] 57s Test #221 57s tick 57s Test #222 57s tick 57s Test #223 57s tick 57s Test #224 57s tick 57s Test #225 57s tick 57s Test #226 57s tick 57s Test #227 57s tick 57s Test #228 57s tick 57s Test #229 57s tick 57s Test #230 57s tick 57s Test #231 57s tick 57s Test #232 57s tick 57s [Code span] 57s Test #233 57s tick 57s Test #234 57s tick 57s Test #235 57s tick 57s Test #236 57s tick 57s Test #237 57s tick 57s Test #238 57s tick 57s Test #239 57s tick 57s Test #240 57s tick 57s Test #241 57s tick 57s Test #242 57s tick 57s Test #243 57s tick 57s Test #244 57s tick 57s Test #245 57s tick 57s [Emphasis and strong emphasis] 57s Test #246 57s tick 57s Test #247 57s tick 57s Test #248 57s tick 57s Test #249 57s tick 57s Test #250 57s tick 57s Test #251 57s tick 57s Test #252 57s tick 57s Test #253 57s tick 57s Test #254 57s tick 57s Test #255 57s tick 57s Test #256 57s tick 57s Test #257 57s tick 57s Test #258 57s tick 57s Test #259 57s tick 57s Test #260 57s tick 57s Test #261 57s tick 57s Test #262 57s tick 57s Test #263 57s tick 57s Test #264 57s tick 57s Test #265 57s tick 57s Test #266 57s tick 57s Test #267 57s tick 57s Test #268 57s tick 57s Test #269 57s tick 57s Test #270 57s tick 57s Test #271 57s tick 57s Test #272 57s tick 57s Test #273 57s tick 57s Test #274 57s tick 57s Test #275 57s tick 57s Test #276 57s tick 57s Test #277 57s tick 57s Test #278 57s tick 57s Test #279 57s tick 57s Test #280 57s tick 57s Test #281 57s tick 57s Test #282 57s tick 57s Test #283 57s tick 57s Test #284 57s tick 57s Test #285 57s tick 57s Test #286 57s tick 57s Test #287 57s tick 57s Test #288 57s tick 57s Test #289 57s tick 57s Test #290 57s tick 57s Test #291 57s tick 57s Test #292 57s tick 57s Test #293 57s tick 57s Test #294 57s tick 57s Test #295 57s tick 57s Test #296 57s tick 57s Test #297 57s tick 57s Test #298 57s tick 57s Test #299 57s tick 57s Test #300 57s tick 57s Test #301 57s tick 57s Test #302 57s tick 57s Test #303 57s tick 57s Test #304 57s tick 57s Test #305 57s tick 57s Test #306 57s tick 57s Test #307 57s tick 57s Test #308 57s tick 57s Test #309 57s tick 57s Test #310 57s tick 57s Test #311 57s tick 57s Test #312 57s tick 57s Test #313 57s tick 57s Test #314 57s tick 57s Test #315 57s tick 57s Test #316 57s tick 57s Test #317 57s tick 57s Test #318 57s tick 57s Test #319 57s tick 57s Test #320 57s tick 57s Test #321 57s tick 57s Test #322 57s tick 57s Test #323 57s tick 57s Test #324 57s tick 57s Test #325 57s tick 57s Test #326 57s tick 57s Test #327 57s tick 57s [Links] 57s Test #328 57s tick 57s Test #329 57s tick 57s Test #330 57s tick 57s Test #331 57s tick 57s Test #332 57s tick 57s Test #333 57s tick 57s Test #334 57s tick 57s Test #335 57s tick 57s Test #336 57s tick 57s Test #337 57s tick 57s Test #338 57s tick 57s Test #339 57s tick 57s Test #340 57s tick 57s Test #341 57s tick 57s Test #342 57s tick 57s Test #343 57s tick 57s Test #344 57s tick 57s Test #345 57s tick 57s Test #346 57s tick 57s Test #347 57s tick 57s Test #348 57s tick 57s Test #349 57s tick 57s Test #350 57s tick 57s Test #351 57s tick 57s Test #352 57s tick 57s Test #353 57s tick 57s Test #354 57s tick 57s Test #355 57s tick 57s Test #356 57s tick 57s Test #357 57s tick 57s Test #358 57s tick 57s Test #359 57s tick 57s Test #360 57s tick 57s Test #361 57s tick 57s Test #362 57s tick 57s Test #363 57s tick 57s Test #364 57s tick 57s Test #365 57s tick 57s Test #366 57s tick 57s Test #367 57s tick 57s Test #368 57s tick 57s Test #369 57s tick 57s Test #370 57s tick 57s Test #371 57s tick 57s Test #372 57s tick 57s Test #373 57s tick 57s Test #374 57s tick 57s Test #375 57s tick 57s [Images] 57s Test #376 57s tick 57s Test #377 57s tick 57s Test #378 57s tick 57s Test #379 57s tick 57s Test #380 57s tick 57s Test #381 57s tick 57s Test #382 57s tick 57s Test #383 57s tick 57s Test #384 57s tick 57s Test #385 57s tick 57s Test #386 57s tick 57s Test #387 57s tick 57s Test #388 57s tick 57s Test #389 57s tick 57s Test #390 57s tick 57s Test #391 57s tick 57s Test #392 57s tick 57s Test #393 57s tick 57s Test #394 57s tick 57s Test #395 57s tick 57s [Autolinks] 57s Test #396 57s tick 57s Test #397 57s tick 57s Test #398 57s tick 57s Test #399 57s tick 57s Test #400 57s tick 57s Test #401 57s tick 57s Test #402 57s tick 57s Test #403 57s tick 57s Test #404 57s tick 57s Test #405 57s tick 57s Test #406 57s tick 57s Test #407 57s tick 57s Test #408 57s tick 57s Test #409 57s tick 57s [Raw HTML] 57s Test #410 57s tick 57s Test #411 57s tick 57s Test #412 57s tick 57s Test #413 57s tick 57s Test #414 57s tick 57s Test #415 57s tick 57s Test #416 57s tick 57s Test #417 57s tick 57s Test #418 57s tick 57s Test #419 57s tick 57s Test #420 57s tick 57s Test #421 57s tick 57s Test #422 57s tick 57s Test #423 57s tick 57s Test #424 57s tick 57s Test #425 57s tick 57s Test #426 57s tick 57s Test #427 57s tick 57s Test #428 57s tick 57s [Hard line breaks] 57s Test #429 57s tick 57s Test #430 57s tick 57s Test #431 57s tick 57s Test #432 57s tick 57s Test #433 57s tick 57s Test #434 57s tick 57s Test #435 57s tick 57s Test #436 57s tick 57s Test #437 57s tick 57s Test #438 57s tick 57s Test #439 57s tick 57s [Soft line breaks] 57s Test #440 57s tick 57s Test #441 57s tick 57s [Strings] 57s Test #442 57s tick 57s Test #443 57s tick 57s Test #444 57s tick 57s 349 tests passed, 95 failed 57s runtime: 0.027988081999999997s 57s autopkgtest [17:21:32]: test command1: -----------------------] 57s command1 PASS 57s autopkgtest [17:21:32]: test command1: - - - - - - - - - - results - - - - - - - - - - 57s autopkgtest [17:21:32]: @@@@@@@@@@@@@@@@@@@@ summary 57s command1 PASS