xoofx / markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
BSD 2-Clause "Simplified" License
4.21k stars 444 forks source link

Using context for extensions #777

Open leotsarev opened 4 months ago

leotsarev commented 4 months ago

When my extension is rendering, it needs access to MarkdownParserContext. Now I has to pass context through Inline objects, and i don't like it. Is there way to extension to access it?

xoofx commented 4 months ago

As per the name MarkdownParserContext, it was added for accessing it from parsing. It should be possible to modify the code to have this context passed around. We might have to rename it though (e.g MardownContext or something)

leotsarev commented 4 months ago

We might have to rename it though (e.g MardownContext or something) It would be a breaking change...

xoofx commented 4 months ago

It would be a breaking change...

Markdig is not 1.0, so we don't make a promise about not making breaking changes.

xoofx commented 4 months ago

But that doesn't mean that we can't find a solution that provide backward compatibility. If there is a path, that's better for sure. 🙂