Fix indenting issue after a double digit list block using a tab (#134)

This commit is contained in:
Alexandre Mutel
2017-08-21 16:04:47 +02:00
parent c761fa2243
commit bb30dc21c5
2 changed files with 16 additions and 5 deletions

View File

@@ -12,6 +12,18 @@ namespace Markdig.Tests
[TestFixture]
public class TestPlayParser
{
[Test]
public void TestListBug2()
{
TestParser.TestSpec("10.\t*test* test\n\n11.\t__test__ test\n\n", @"<ol start=""10"">
<li><p><em>test</em> test</p>
</li>
<li><p><strong>test</strong> test</p>
</li>
</ol>
");
}
[Test]
public void TestSimple()
{

View File

@@ -230,17 +230,16 @@ namespace Markdig.Parsers
return BlockState.None;
}
// We require at least one char
state.NextColumn();
// Parse the following indent
state.RestartIndent();
var columnBeforeIndent = state.Column;
state.ParseIndent();
if (state.IsCodeIndent)
// We expect at most 4 columns after
// If we have more, we reset the position
if (state.Indent > 4)
{
state.GoToColumn(columnBeforeIndent);
state.GoToColumn(columnBeforeIndent + 1);
}
// Number of spaces required for the following content to be part of this list item