Fix regression for html block parsing (issue #21)

This commit is contained in:
Alexandre Mutel
2016-06-23 05:49:24 +09:00
parent 46ef21a3ed
commit a7cdb2351a
2 changed files with 18 additions and 1 deletions

View File

@@ -51,6 +51,23 @@ Later in a text we are using HTML and it becomes an abbr tag HTML
}
[Test]
public void TestHtmlBug()
{
TestParser.TestSpec(@" # header1
<pre class='copy'>
blabla
</pre>
# header2
", @"<h1>header1</h1>
<pre class='copy'>
blabla
</pre>
<h1>header2</h1>");
}
[Test]

View File

@@ -249,7 +249,7 @@ namespace Markdig.Helpers
endOfIndex = 0;
for (int i = Start; i <= end; i++)
{
if (MatchLowercase(text, End, i))
if (MatchLowercase(text, End, i - Start))
{
endOfIndex = i + text.Length;
return true;