fix(doc-intel): include HTML in the default DocumentIntelligenceConverter file types - #2350
Open
Tai An (Anai-Guo) wants to merge 1 commit into
Open
fix(doc-intel): include HTML in the default DocumentIntelligenceConverter file types#2350Tai An (Anai-Guo) wants to merge 1 commit into
Tai An (Anai-Guo) wants to merge 1 commit into
Conversation
|
Tai An (@Anai-Guo) 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”),
|
…rter file types The constructor documents file_types as "Defaults to all supported file types", but the default list has never contained DocumentIntelligenceFileType.HTML, even though the enum lists it under "# No OCR" and _get_mime_type_prefixes / _get_file_extensions / _analysis_features all handle it. So accepts() rejects .html, text/html and application/xhtml+xml unless the caller passes file_types explicitly. The HTML mappings added in microsoft#1352 are unreachable through the default constructor, and MarkItDown never passes file_types when it builds the converter from docintel_endpoint.
Tai An (Anai-Guo)
force-pushed
the
docintel-default-html
branch
from
August 28, 2026 01:28
9a6c87e to
2b28640
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
DocumentIntelligenceFileType.HTMLto the defaultfile_typesofDocumentIntelligenceConverter.Why
DocumentIntelligenceConverter.__init__documents the parameter as:but the default list has never contained
HTML, even though every other part of the converter treats HTML as supported:DocumentIntelligenceFileTypelistsHTML = "html"under the# No OCRgroup, next toDOCX/PPTX/XLSX— all three of which are in the default._get_mime_type_prefixes()maps it totext/htmlandapplication/xhtml+xml._get_file_extensions()maps it to.html._analysis_features()putsHTMLinno_ocr_types, and its docstring names.htmlexplicitly.accepts()is gated purely onself._file_types, so with the default the converter rejects HTML:This looks like an oversight in #1352 ("Add HTML support to DocumentIntelligenceConverter"): that PR added the mimetype/extension mappings and tests, but the tests construct the converter with
file_types=[DocumentIntelligenceFileType.HTML]explicitly, so the default path was never exercised.MarkItDown.enable_builtins()never passesfile_types, so a user who configuresdocintel_endpointgets HTML support only if they build the converter by hand.Tests
Extends
tests/test_docintel_html.pywith two cases that read the actual default off the signature:test_docintel_default_file_types_cover_every_supported_type— pins the documented "all supported file types" contract to the enum, so the default cannot drift again when a type is added.test_docintel_default_accepts_html— the default converter accepts.html,text/htmlandapplication/xhtml+xml.Both fail on
mainand pass with the change; the two pre-existing tests in the file are untouched and still pass. Formatted withblack==23.7.0(the pinned.pre-commit-config.yamlrevision).🤖 Generated with Claude Code