Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,11 @@ module.exports = class Tokenizer {
// Backpedal if it does not belong in this list.
if (i !== l - 1) {
bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);

if (bnext[1].length > bcurr[0].length || bnext[1].length > 3) {
if (
!this.options.pedantic
? bnext[1].length > bcurr[0].length || bnext[1].length > 3
: bnext[1].length > bcurr[1].length
) {
// nested list
itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]);
i--;
Expand Down
15 changes: 15 additions & 0 deletions test/specs/new/list_align_pedantic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ul>
<li>one
<ul>
<li>two</li>
<li>three</li>
<li>four
<ul>
<li>five</li>
<li>six</li>
<li>seven</li>
</ul>
</li>
</ul>
</li>
</ul>
10 changes: 10 additions & 0 deletions test/specs/new/list_align_pedantic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
pedantic: true
---
- one
- two
- three
- four
- five
- six
- seven