RFC: expose conversion diagnostics without changing Markdown output

Aperta
#2,724 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@macjayz ci sta già lavorando.

Dal 24/10/2026.

  • #2751 di @macjayz — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Read the DocumentConverterResult definition and the conversion entry point that produces it, then trace how converters select formats and charsets. The issue leaves the public API shape and diagnostic fields open for maintainer discussion; first agree on those choices, then define tests for opt-in behavior and unchanged default Markdown output.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

MarkItDown is increasingly used in ingestion pipelines where a Markdown string alone is not enough to operate safely. Callers often need to know which converter handled an input, which charset was selected, whether a fallback was used, and whether optional/cloud processing was involved. Today they must infer this from filenames, logs, or by reimplementing internal detection.

This makes it difficult to:

  • audit or reproduce a conversion;
  • detect low-confidence charset or format decisions;
  • measure converter coverage in a heterogeneous corpus; and
  • decide when a result should be reviewed instead of indexed automatically.

Proposal

Add opt-in diagnostics to DocumentConverterResult, for example:

result = md.convert(path, include_diagnostics=True)
result.diagnostics.converter  # PlainTextConverter
result.diagnostics.charset  # utf-8 or cp1252
result.diagnostics.charset_confidence  # optional numeric/confidence bucket
result.diagnostics.warnings  # list[str]

The default result would remain unchanged, and diagnostics should avoid exposing input contents or credentials. A CLI representation such as --diagnostics json could make the same information available to ingestion tools.

Questions for maintainers and users

  1. Should diagnostics be part of DocumentConverterResult, a separate callback, or a tracing/logging hook?
  2. Which fields are stable enough to expose as public API (converter identity, MIME type, charset, fallback reason, dependency/cloud usage)?
  3. Should low-confidence decisions be warnings only, or should callers be able to configure a failure threshold?
  4. Would a machine-readable CLI mode be useful, and if so should it write diagnostics to stderr or a sidecar file?

I would be happy to help prototype this if the maintainers agree on the API shape.

Lingua principale
Python
Stelle
198k
Fork
15k
Merge medio
2h 16m
PR unite (30g)
9

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/markitdown

Tutte le issue di microsoft/markitdown

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.