You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did not really take a closer look why this is happening but the problem is DefinitionListParser.GetCurrentDefinitionList() calling previousParent with index = -1 if the lastBlock is a BlankLineBlock.
if (lastBlock is BlankLineBlock)
{
lastBlock = previousParent[index - 1];
previousParent.RemoveAt(index);
}
Casting -1 to an unsigned int is then problematic.
Reproducer:
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
var result = Markdown.ToHtml("+\r\n\r\n+\r\n\r\n\t\f\r\n~\t", pipeline);
or
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
var result = Markdown.ToHtml("- \r\n\r\n\t\f\r\n~\t", pipeline);
Stacktrace:
ThrowHelper removed for Stacktrace.
at Markdig.Syntax.ContainerBlock.get_Item(Int32 index) in \src\Markdig\Syntax\ContainerBlock.cs:line 220
at Markdig.Extensions.DefinitionLists.DefinitionListParser.GetCurrentDefinitionList(ParagraphBlock paragraphBlock, ContainerBlock previousParent) in \src\Markdig\Extensions\DefinitionLists\DefinitionListParser.cs:line 111
at Markdig.Extensions.DefinitionLists.DefinitionListParser.TryOpen(BlockProcessor processor) in \src\Markdig\Extensions\DefinitionLists\DefinitionListParser.cs:line 53
at Markdig.Parsers.BlockProcessor.TryOpenBlocks(BlockParser[] parsers) in \src\Markdig\Parsers\BlockProcessor.cs:line 821
at Markdig.Parsers.BlockProcessor.TryOpenBlocks() in \src\Markdig\Parsers\BlockProcessor.cs:line 763
at Markdig.Parsers.BlockProcessor.ProcessLine(StringSlice newLine) in \src\Markdig\Parsers\BlockProcessor.cs:line 501
at Markdig.Parsers.MarkdownParser.ProcessBlocks(BlockProcessor blockProcessor, String text) in \src\Markdig\Parsers\MarkdownParser.cs:line 113
at Markdig.Parsers.MarkdownParser.Parse(String text, MarkdownPipeline pipeline, MarkdownParserContext context) in \src\Markdig\Parsers\MarkdownParser.cs:line 56
at Markdig.Markdown.ToHtml(String markdown, MarkdownPipeline pipeline, MarkdownParserContext context) in \src\Markdig\Markdown.cs:line 101
at FuzzTest.Program.Main(String[] args) in \FuzzingTargets\MarkdigFuzzer\Program.cs:line 14
The text was updated successfully, but these errors were encountered:
Tested Version: newest commit d1233ff on main
I did not really take a closer look why this is happening but the problem is DefinitionListParser.GetCurrentDefinitionList() calling previousParent with index = -1 if the lastBlock is a BlankLineBlock.
Casting -1 to an unsigned int is then problematic.
Reproducer:
or
Stacktrace:
ThrowHelper removed for Stacktrace.
The text was updated successfully, but these errors were encountered: