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

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/213
Author: @augustoproiete
Created: 2/21/2018
Status: Merged
Merged: 2/23/2018
Merged by: @xoofx

Base: masterHead: add-new-use-extension-with-instance


📝 Commits (1)

  • fea2ca5 Add alternative Use extension method to MarkdownPipelineBuilder that receives an object instance

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 src/Markdig/MarkdownExtensions.cs (+13 -0)

📄 Description

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();

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/xoofx/markdig/pull/213 **Author:** [@augustoproiete](https://github.com/augustoproiete) **Created:** 2/21/2018 **Status:** ✅ Merged **Merged:** 2/23/2018 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `add-new-use-extension-with-instance` --- ### 📝 Commits (1) - [`fea2ca5`](https://github.com/xoofx/markdig/commit/fea2ca5adfa3c6058d53ee38723d98a737a2392c) Add alternative `Use` extension method to `MarkdownPipelineBuilder` that receives an object instance ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig/MarkdownExtensions.cs` (+13 -0) </details> ### 📄 Description 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(); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#868