Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1e36afd

Browse filesBrowse files
authored
fix: allow sublist to be single space in pedantic (#1924)
1 parent b97b802 commit 1e36afd
Copy full SHA for 1e36afd

File tree

3 files changed

+30
-2
lines changed
Filter options

3 files changed

+30
-2
lines changed

‎src/Tokenizer.js

Copy file name to clipboardExpand all lines: src/Tokenizer.js
+5-2Lines changed: 5 additions & 2 deletions
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--;
+15Lines changed: 15 additions & 0 deletions
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

Copy file name to clipboard
+10Lines changed: 10 additions & 0 deletions
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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.