mirror of
https://github.com/xoofx/markdig.git
synced 2026-10-07 06:08:22 +00:00
ContainerBlock CopyTo IndexOutOfRangeException #529
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ladeak on GitHub (Apr 21, 2022).
When I call ToList() on a ContainerBlock (ListItemBlock) with a single item in it, I get a IndexOutOfRangeException.
Stacktrace:
This seems to be a regression since v28.1. I am still further looking into the detailts.
(.NET6, Blazor app)
@MihaZupan commented on GitHub (Apr 21, 2022):
Caused by a typo here:
a4a1a177bc/src/Markdig/Syntax/ContainerBlock.cs (L133)Should be
arrayIndex + iinstead ofarrayIndex + 1.As a temporary workaround, you can avoid the
CopyTo.@ladeak commented on GitHub (Apr 21, 2022):
I was wondering why I did not find this piece of code... GitHub search has taken me to a different version of the file. 😡
It seems calling ToList() on MarkdownDocument results a weird list of, probably also caused by the same typo.