[PR #216] Changed: Configure extensions by reflection #879

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

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

State: closed
Merged: No


Hey

This PR is a suggestion for something further in the future.

I changed to the MarkdownExtensions.Configure() method to work with reflection, therefore grabbing all classes implementing the IMarkdownExtension interface and adding them to the pipeline if configured.

I thought of this to be a little more flexible also in the future without having to adapt the switch/case all the time.

But: I know the change is drastic! And it's not 100% backwards compatible to previous Configure() strings as I work with the extension class name which isn't the same as in the switch case for every plugin.

I adapted the tests accordingly and also added a small test for my changes.

I am open for feedback and suggestions as I would be happy to have this system as flexible as possible to use in the future.

Thanks

**Original Pull Request:** https://github.com/xoofx/markdig/pull/216 **State:** closed **Merged:** No --- Hey This PR is a suggestion for something further in the future. I changed to the _MarkdownExtensions.Configure()_ method to work with reflection, therefore grabbing all classes implementing the _IMarkdownExtension_ interface and adding them to the pipeline if configured. I thought of this to be a little more flexible also in the future without having to adapt the switch/case all the time. But: I know the change is drastic! And it's not 100% backwards compatible to previous _Configure()_ strings as I work with the extension class name which isn't the same as in the switch case for every plugin. I adapted the tests accordingly and also added a small test for my changes. I am open for feedback and suggestions as I would be happy to have this system as flexible as possible to use in the future. Thanks
claunia added the pull-request label 2026-01-29 14:46:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#879