Skip to content

Conversation

@christophano
Copy link
Contributor

I've found an odd situation where the AbbreviationParser throws a cast exception when processor.Inline is not of type LiteralInline. See lines 69-90 of LiteralInlineParser. In my case the type was EmphasisDelimiterInline and the current StringSlice was empty.

There are 2 ways I could have gone about this. I have chosen to assume that it is valid to expect the LiteralInlineParser to only call the PostMatch event when the processor.Inline type is LiteralInline so 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.

@xoofx xoofx merged commit 0aa34ca into xoofx:master Sep 22, 2016
@xoofx
Copy link
Owner

xoofx commented Sep 22, 2016

Good catch, the post processor on the LiteralInlineParser has only to deal with LiteralInline so your fix is spot-on, thanks again.

@christophano christophano deleted the bugfix/literal-inline-parser branch September 22, 2016 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants