Any way of accessing (external) contextual data in a parser? #258

Open
opened 2026-01-29 14:31:55 +00:00 by claunia · 0 comments
Owner

Originally created by @patriksvensson on GitHub (Jan 10, 2019).

I've written a MarkDig parser and in the parser I would want to get access to some contextual information about the document being parsed (that's not available in the document itself).

Is there any way of passing contextual data to a parser on a parse basis (just like I can in Scriban when rendering)?

// Something like this?
var html = Markdown.ToHtml(markdown, _pipeline, context);

If there is no work around for my problem, I would be happy to provide a pull request for this functionality if you think it would be a good fit for MarkDig.

Originally created by @patriksvensson on GitHub (Jan 10, 2019). I've written a MarkDig parser and in the parser I would want to get access to some contextual information about the document being parsed (that's not available in the document itself). Is there any way of passing contextual data to a parser on a parse basis (just like I can in Scriban when rendering)? ```csharp // Something like this? var html = Markdown.ToHtml(markdown, _pipeline, context); ``` If there is no work around for my problem, I would be happy to provide a pull request for this functionality if you think it would be a good fit for MarkDig.
claunia added the question label 2026-01-29 14:31:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#258