Skip to content

Commit 1e36afd

Browse files
authoredFeb 3, 2021
fix: allow sublist to be single space in pedantic (#1924)
1 parent b97b802 commit 1e36afd

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed
 

‎src/Tokenizer.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,11 @@ module.exports = class Tokenizer {
241241
// Backpedal if it does not belong in this list.
242242
if (i !== l - 1) {
243243
bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);
244-
245-
if (bnext[1].length > bcurr[0].length || bnext[1].length > 3) {
244+
if (
245+
!this.options.pedantic
246+
? bnext[1].length > bcurr[0].length || bnext[1].length > 3
247+
: bnext[1].length > bcurr[1].length
248+
) {
246249
// nested list
247250
itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]);
248251
i--;
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<ul>
2+
<li>one
3+
<ul>
4+
<li>two</li>
5+
<li>three</li>
6+
<li>four
7+
<ul>
8+
<li>five</li>
9+
<li>six</li>
10+
<li>seven</li>
11+
</ul>
12+
</li>
13+
</ul>
14+
</li>
15+
</ul>

‎test/specs/new/list_align_pedantic.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
pedantic: true
3+
---
4+
- one
5+
- two
6+
- three
7+
- four
8+
- five
9+
- six
10+
- seven

1 commit comments

Comments
 (1)
Please sign in to comment.