Merge branch 'docling-project:main' into main

This commit is contained in:
ShiroYasha18 2025-05-08 04:18:18 +05:30 committed by GitHub
commit 54d2422ad3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -303,6 +303,14 @@ class _DocumentConversionInput(BaseModel):
else "" else ""
) )
mime = _DocumentConversionInput._mime_from_extension(ext) mime = _DocumentConversionInput._mime_from_extension(ext)
if mime is not None and mime.lower() == "application/zip":
objname = obj.name.lower()
if objname.endswith(".xlsx"):
mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
elif objname.endswith(".docx"):
mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
elif objname.endswith(".pptx"):
mime = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
mime = mime or _DocumentConversionInput._detect_html_xhtml(content) mime = mime or _DocumentConversionInput._detect_html_xhtml(content)
mime = mime or _DocumentConversionInput._detect_csv(content) mime = mime or _DocumentConversionInput._detect_csv(content)