Skip to content

Commit 64a299d

Browse files
fix: recognize task list items when a tab follows the checkbox (#4163)
1 parent e43ceef commit 64a299d

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

‎src/rules.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export const other = {
6464
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
6565
blockquoteMarkerWhitespace: /^( {0,3}>)([ \t]+)/gm,
6666
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
67-
listIsTask: /^\[[ xX]\] +\S/,
68-
listReplaceTask: /^\[[ xX]\] +/,
67+
listIsTask: /^\[[ xX]\][ \t]+\S/,
68+
listReplaceTask: /^\[[ xX]\][ \t]+/,
6969
listTaskCheckbox: /\[[ xX]\]/,
7070
anyLine: /\n.*\n/,
7171
hrefBrackets: /^<(.*)>$/,

‎test/specs/new/tasklist_tab.html‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<h1>tab after the marker</h1>
2+
<ul>
3+
<li><input disabled="" type="checkbox"> item</li>
4+
<li><input checked="" disabled="" type="checkbox"> item</li>
5+
</ul>
6+
<h1>space and tab after the marker</h1>
7+
<ul>
8+
<li><input checked="" disabled="" type="checkbox"> item</li>
9+
</ul>

‎test/specs/new/tasklist_tab.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# tab after the marker
2+
3+
- [ ] item
4+
- [x] item
5+
6+
# space and tab after the marker
7+
8+
- [X] item

0 commit comments

Comments
 (0)