Skip to content

Commit 1b04599

Browse files
authored
Merge pull request #888 from prozolic/pullreq
Fixes issue #845
2 parents 2aa6780 + 5e6fb2d commit 1b04599

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/Markdig.Tests/MiscTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,4 +386,27 @@ Also not a note.</p>
386386
";
387387
TestParser.TestSpec(input, expected, new MarkdownPipelineBuilder().UseAlertBlocks().Build());
388388
}
389+
390+
391+
[Test]
392+
public void TestIssue845ListItemBlankLine()
393+
{
394+
TestParser.TestSpec("-\n\n foo",@"
395+
<ul>
396+
<li></li>
397+
</ul>
398+
<p>foo</p>");
399+
TestParser.TestSpec("-\n-\n\n foo",@"
400+
<ul>
401+
<li></li>
402+
<li></li>
403+
</ul>
404+
<p>foo</p>");
405+
TestParser.TestSpec("-\n\n-\n\n foo",@"
406+
<ul>
407+
<li></li>
408+
<li></li>
409+
</ul>
410+
<p>foo</p>");
411+
}
389412
}

src/Markdig/Parsers/ListBlockParser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private BlockState TryContinueListItem(BlockProcessor state, ListItemBlock listI
145145
if (list.CountBlankLinesReset == 1 && listItem.ColumnWidth < 0)
146146
{
147147
state.Close(listItem);
148+
list.CountBlankLinesReset = 0;
148149

149150
// Leave the list open
150151
list.IsOpen = true;

0 commit comments

Comments
 (0)