mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[PR #61] [MERGED] Fixes issue where LiteralInlineParser calls PostMatch while processor.Inline is type other than LiteralInline #799
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?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/61
Author: @christophano
Created: 9/22/2016
Status: ✅ Merged
Merged: 9/22/2016
Merged by: @xoofx
Base:
master← Head:bugfix/literal-inline-parser📝 Commits (1)
98ce9b1Fixes issue where LiteralInlineParser calls PostMatch while processor.Inline is type other than LiteralInline📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
src/Markdig/Parsers/Inlines/LiteralInlineParser.cs(+2 -2)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.