Fixed extensions getting randomized.

This commit is contained in:
Adam Fourney 2025-02-28 00:52:24 -08:00
parent d565e77592
commit adf87dbe9f

View file

@ -1701,8 +1701,6 @@ class MarkItDown:
def _convert( def _convert(
self, local_path: str, extensions: List[Union[str, None]], **kwargs self, local_path: str, extensions: List[Union[str, None]], **kwargs
) -> DocumentConverterResult: ) -> DocumentConverterResult:
# Deduplicate the list of extensions
extensions = list(set(extensions))
error_trace = "" error_trace = ""
for ext in extensions + [None]: # Try last with no extension for ext in extensions + [None]: # Try last with no extension
@ -1766,6 +1764,8 @@ class MarkItDown:
ext = ext.strip() ext = ext.strip()
if ext == "": if ext == "":
return return
if ext in extensions:
return
# if ext not in extensions: # if ext not in extensions:
extensions.append(ext) extensions.append(ext)