Fix IndexOutOfRangeException while parsing fenced code block with a single trailing space (#276)

This commit is contained in:
Alexandre Mutel
2018-12-28 10:30:37 +01:00
parent 28322c3645
commit ebedc6829d
2 changed files with 8 additions and 1 deletions

View File

@@ -27,6 +27,13 @@ namespace Markdig.Tests
TestSpec(input, "<p>9&amp;ddr;&amp;*&amp;ddr;&amp;de<64><65>__</p>");
}
[Test]
public void TestInvalidCodeEscape()
{
var input = "```**Header** ";
var html = Markdown.ToHtml(input);
}
[Test]
public void TestEmphasisAndHtmlEntity()
{

View File

@@ -94,7 +94,7 @@ namespace Markdig.Parsers
// Skip any spaces after info string
firstSpace++;
while (true)
while (firstSpace <= line.End)
{
c = line[firstSpace];
if (c.IsSpaceOrTab())