mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-13 05:45:31 +00:00
[PR #216] Changed: Configure extensions by reflection #879
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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