Add disabled_converters support for built-ins#1686
Conversation
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.
|
@microsoft-github-policy-service agree |
|
CLA is complete from my end now. |
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"