Skip to content

Commit

Permalink
Fix invalid setext heading (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Mar 26, 2024
1 parent a579689 commit 000393f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/Markdig.Tests/TestPlayParser.cs
Expand Up @@ -9,6 +9,13 @@ namespace Markdig.Tests;
[TestFixture]
public class TestPlayParser
{

[Test]
public void TestInvalidSetext()
{
TestParser.TestSpec("test\n===n", "<p>test\n===n</p>", "advanced");
}

[Test]
public void TestBugWithEmphasisAndTable()
{
Expand Down
8 changes: 2 additions & 6 deletions src/Markdig/Parsers/ParagraphBlockParser.cs
Expand Up @@ -171,13 +171,9 @@ private static char GetHeadingChar(ref StringSlice line, ref int count)
{
count = line.CountAndSkipChar(headingChar);

if (line.IsEmpty)
{
return headingChar;
}

while (line.NextChar().IsSpaceOrTab())
while (line.CurrentChar.IsSpaceOrTab())
{
line.NextChar();
}

if (line.IsEmpty)
Expand Down

0 comments on commit 000393f

Please sign in to comment.