From adf87dbe9ff0162e4d28be295f686eb4ab89cd19 Mon Sep 17 00:00:00 2001 From: Adam Fourney Date: Fri, 28 Feb 2025 00:52:24 -0800 Subject: [PATCH] Fixed extensions getting randomized. --- src/markitdown/_markitdown.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.py index 425308f..2f8d141 100644 --- a/src/markitdown/_markitdown.py +++ b/src/markitdown/_markitdown.py @@ -1701,8 +1701,6 @@ class MarkItDown: def _convert( self, local_path: str, extensions: List[Union[str, None]], **kwargs ) -> DocumentConverterResult: - # Deduplicate the list of extensions - extensions = list(set(extensions)) error_trace = "" for ext in extensions + [None]: # Try last with no extension @@ -1766,6 +1764,8 @@ class MarkItDown: ext = ext.strip() if ext == "": return + if ext in extensions: + return # if ext not in extensions: extensions.append(ext)