microsoft / microsoft/markitdown

No way to disable specific built-in converters without subclassing

Open
#1,665 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
186k
Forks
13.7k
Avg merge
1d 4h
Merged PRs (30d)
49

Description

Problem

When you call MarkItDown(), all built-in converters are registered. There is no way to exclude specific converters without subclassing MarkItDown and overriding enable_builtins.

This creates friction in two common cases:

  1. Security hardening. A deployment that serves untrusted files might want to disable ZipConverter (to prevent zip bombs even with the existing limits) or AudioConverter (to avoid network calls to Whisper APIs on untrusted audio files). Right now this requires a custom subclass.

  2. Dependency management. Some converters require optional extras (mammoth for DOCX, pptx for PowerPoint, speech_recognition for audio). If a user installs markitdown without those extras, the converter registration silently does nothing. A user who wants to explicitly opt in to only a specific set of converters has no clean way to do that.

Proposed API

# Option A: exclusion list
md = MarkItDown(disabled_converters=["ZipConverter", "AudioConverter"])

# Option B: explicit inclusion (no built-ins except what you list)
md = MarkItDown(enable_builtins=False)
md.register_converter(PdfConverter())
md.register_converter(HtmlConverter())

# Option B already partially works - enable_builtins=False would just skip the auto-registration

Option A is the lower-friction change. The enable_builtins method could accept an exclude parameter:

def enable_builtins(self, md: "MarkItDown", exclude: list[str] | None = None) -> None:
    ...

Notes

  • This is purely an API surface change with no impact on converter logic
  • The exclude list could match on class name strings to avoid importing converter classes just to exclude them

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the MarkItDown constructor and its enable_builtins entry point to understand how built-in converters are registered. Add the proposed way to exclude named converters while preserving current default registration, then verify that excluded converters are not registered and existing behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.