[PR #213] Add alternative Use extension method to MarkdownPipelineBuilder that receives an object instance #873

Closed
opened 2026-01-29 14:46:38 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/xoofx/markdig/pull/213

State: closed
Merged: Yes


This PR adds an overload of the MarkdownPipelineBuilder.Use<T> method that receives an instance of an IMarkdownExtension, for the cases where the extension has a constructor requiring parameters and cannot be instantiated by the existing Use<T> method.

Syntax looks like this:

var pipeline = new MarkdownPipelineBuilder()
	.Use(new MyAwesomeExtension("param1", "param2")) // <== here
	.UseAdvancedExtensions()
	.Build();
**Original Pull Request:** https://github.com/xoofx/markdig/pull/213 **State:** closed **Merged:** Yes --- This PR adds an overload of the `MarkdownPipelineBuilder.Use<T>` method that receives an instance of an `IMarkdownExtension`, for the cases where the extension has a constructor requiring parameters and cannot be instantiated by the existing `Use<T>` method. Syntax looks like this: ```csharp var pipeline = new MarkdownPipelineBuilder() .Use(new MyAwesomeExtension("param1", "param2")) // <== here .UseAdvancedExtensions() .Build(); ```
claunia added the pull-request label 2026-01-29 14:46:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#873