mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[PR #61] Fixes issue where LiteralInlineParser calls PostMatch while processor.Inline is type other than LiteralInline #802
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?
Original Pull Request: https://github.com/xoofx/markdig/pull/61
State: closed
Merged: Yes
I've found an odd situation where the
AbbreviationParserthrows a cast exception whenprocessor.Inlineis not of typeLiteralInline. See lines 69-90 ofLiteralInlineParser. In my case the type wasEmphasisDelimiterInlineand the currentStringSlicewas empty.There are 2 ways I could have gone about this. I have chosen to assume that it is valid to expect the
LiteralInlineParserto only call thePostMatchevent when theprocessor.Inlinetype isLiteralInlineso have changed the event raising code accordingly.The alternative is that the consuming code should not make assumptions about the type of inline that the processor is handling and should handle it accordingly. Let me know if you'd rather I went down this route.