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

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

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

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

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

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

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

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

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

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

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

133s
133s

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

133s
133s

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

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

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

133s

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

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

Compare:

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

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

133s

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

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

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

133s

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

133s

Link␣reference␣definitions

133s

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

133s

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

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

The␣title␣may␣be␣omitted:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Paragraphs

133s

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

133s

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

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

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

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

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

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

Leading␣spaces␣are␣skipped:

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

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

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

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

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

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

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

Blank␣lines

133s

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

133s

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

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

Container␣blocks

133s

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

133s

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

133s
133s

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

133s
133s

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

133s

Block␣quotes

133s

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

133s

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

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

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

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

  6. 133s
133s

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

133s

Here␣is␣a␣simple␣example:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

foo

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

foo

133s
133s 133s Test #142 133s cross 133s === markdown =============== 133s 
133s

foo

133s
133s
133s

bar

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

foo

133s
133s
133s

bar

133s
133s 133s Test #143 133s cross 133s === markdown =============== 133s 
133s

foo 133s bar

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

foo 133s bar

133s
133s 133s Test #144 133s cross 133s === markdown =============== 133s 
133s

foo

133s

bar

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

foo

133s

bar

133s
133s 133s Test #145 133s cross 133s === markdown =============== 133s 

foo

133s
133s

bar

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

foo

133s
133s

bar

133s
133s 133s Test #146 133s cross 133s === markdown =============== 133s 
133s

aaa

133s
133s 133s
133s

bbb

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

aaa

133s
133s 133s
133s

bbb

133s
133s 133s Test #147 133s cross 133s === markdown =============== 133s 
133s

bar 133s baz

133s
133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 
133s

bar 133s baz

133s
133s 133s Test #148 133s cross 133s === markdown =============== 133s 
133s

bar

133s
133s

baz

133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 
133s

bar

133s
133s

baz

133s 133s Test #149 133s cross 133s === markdown =============== 133s 
133s

bar

133s
133s

baz

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

bar

133s
133s

baz

133s 133s Test #150 133s cross 133s === markdown =============== 133s 
133s
133s
133s

foo 133s bar

133s
133s
133s
133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 
133s
133s
133s

foo 133s bar

133s
133s
133s
133s 133s Test #151 133s cross 133s === markdown =============== 133s 
133s
133s
133s

foo 133s bar 133s baz

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

foo 133s bar 133s baz

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

not␣code

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

not␣code

133s
133s 133s Test #153 133s cross 133s === markdown =============== 133s 

A␣paragraph 133s with␣two␣lines.

133s
indented␣code
133s 
133s
133s

A␣block␣quote.

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

A␣paragraph 133s with␣two␣lines.

133s
indented␣code
133s 
133s
133s

A␣block␣quote.

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

    133s
    indented␣code
    133s 
    133s
    133s

    A␣block␣quote.

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

    133s
    indented␣code
    133s 
    133s
    133s

    A␣block␣quote.

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

two

133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 
    133s
  • one
  • 133s
133s

two

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

    133s

    two

  • 133s
133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 
    133s
  • one

    133s

    two

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

    133s

    two

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

    133s

    two

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

    133s

    two

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

    133s

    two

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

two

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

two

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

    133s

    bar

  • 133s
  • foo

  • 133s
133s

bar

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

    133s

    bar

  • 133s
  • foo

  • 133s
133s

bar

133s
    133s
  • foo
    133s 

    bar 133s

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

    133s
    bar
    133s 
    133s

    baz

    133s
    133s

    bam

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

    133s
    bar
    133s 
    133s

    baz

    133s
    133s

    bam

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

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

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

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

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

    paragraph

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

    paragraph

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

      paragraph

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

      paragraph

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

      paragraph

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

      paragraph

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

    foo

    133s

    bar

    133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 

    foo

    133s

    bar

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

    bar

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

    bar

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

      133s

      bar

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

      133s

      bar

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      133s
      indented␣code
      133s 
      133s
      133s

      A␣block␣quote.

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

      Blockquote 133s continued␣here.

      133s
    2. 133s
    133s
    133s  133s === expected =============== 133s  133s  133s === got ==================== 133s 
    133s
      133s
    1. 133s

      Blockquote 133s continued␣here.

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

      Blockquote 133s continued␣here.

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

      Blockquote 133s continued␣here.

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

    bar

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

      133s

      bar

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

      133s

      two

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