Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow sublist to be single space in pedantic #1924

Merged
merged 1 commit into from Feb 3, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Tokenizer.js
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
@@ -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
@@ -0,0 +1,10 @@
---
pedantic: true
---
- one
- two
- three
- four
- five
- six
- seven