Add disabled_converters support for built-ins#1686
Add disabled_converters support for built-ins#1686txhno wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
@txhno please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
VANDRANKI
left a comment
There was a problem hiding this comment.
Thanks for implementing this. The approach is clean and addresses what the issue asked for.
maybe_register helper - good pattern. Keeps the registration block readable without repeating the guard on every line.
Class name strings - type(converter).__name__ not in disabled_converters is the right check. Callers do not need to import converter classes, which was the core ask.
Priority refactor - I checked: register_converter defaults to PRIORITY_SPECIFIC_FILE_FORMAT, so assigning it explicitly to RssConverter, WikipediaConverter, etc. only makes the implicit default visible. No behavioral change.
Tests - both paths covered: MarkItDown(disabled_converters=...) constructor and enable_builtins(disabled_converters=...) directly. The registered_converter_names helper is reusable.
LGTM.
Closes #1665.
Adds a
disabled_convertersoption to built-in registration and covers it with focused tests.Validation:
pytest tests/test_module_misc.py -k "disabled_converters or enable_builtins_with_disabled_converters"