From 6ecc4f444f8e17089a41a06be4f0ad15416cf2f9 Mon Sep 17 00:00:00 2001 From: Mauro Druwel Date: Mon, 23 Dec 2024 15:52:22 +0100 Subject: [PATCH] pre-commit changes --- src/markitdown/_markitdown.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/markitdown/_markitdown.py b/src/markitdown/_markitdown.py index a8c8371..fa0f2b5 100644 --- a/src/markitdown/_markitdown.py +++ b/src/markitdown/_markitdown.py @@ -699,7 +699,7 @@ class DocxConverter(HtmlConverter): def sanitize_filename(self, name: str) -> str: """Sanitizes a string to make it a valid file name.""" # Normalize whitespace - name = re.sub(r'\s+', " ", name.strip()) + name = re.sub(r"\s+", " ", name.strip()) # Replace invalid characters with underscores return re.sub(r'[\\/*?:"<>|]', "_", name) @@ -720,7 +720,9 @@ class DocxConverter(HtmlConverter): # Return an empty src if saving fails return {"src": ""} - def convert(self, local_path: str, **kwargs) -> Union[None, DocumentConverterResult]: + def convert( + self, local_path: str, **kwargs + ) -> Union[None, DocumentConverterResult]: # Bail if not a DOCX extension = kwargs.get("file_extension", "") if extension.lower() != ".docx": @@ -734,7 +736,9 @@ class DocxConverter(HtmlConverter): mammoth_result = convert_to_html( docx_file, style_map=style_map, - convert_image=images.inline(lambda img: self.convert_image(img, image_output_dir)), + convert_image=images.inline( + lambda img: self.convert_image(img, image_output_dir) + ), ) html_content = mammoth_result.value