Python tool for converting files and office documents to Markdown.
Resolved an issue with linked images in docx [mammoth] (#1405)
afourney9278119bb382
diff --git a/packages/markitdown/pyproject.toml b/packages/markitdown/pyproject.tomlindex afb5d319..0d9bb616 100644--- a/packages/markitdown/pyproject.toml+++ b/packages/markitdown/pyproject.toml@@ -36,7 +36,7 @@ dependencies = [[project.optional-dependencies]all = ["python-pptx",- "mammoth",+ "mammoth~=1.10.0","pandas","openpyxl","xlrd",diff --git a/packages/markitdown/src/markitdown/__about__.py b/packages/markitdown/src/markitdown/__about__.pyindex d2336ca4..4441f3f9 100644--- a/packages/markitdown/src/markitdown/__about__.py+++ b/packages/markitdown/src/markitdown/__about__.py@@ -1,4 +1,4 @@# SPDX-FileCopyrightText: 2024-present Adam Fourney <[email protected]>## SPDX-License-Identifier: MIT-__version__ = "0.1.2"+__version__ = "0.1.3"diff --git a/packages/markitdown/src/markitdown/converters/_docx_converter.py b/packages/markitdown/src/markitdown/converters/_docx_converter.pyindex 69c1ea83..9cb2cbd5 100644--- a/packages/markitdown/src/markitdown/converters/_docx_converter.py+++ b/packages/markitdown/src/markitdown/converters/_docx_converter.py@@ -1,4 +1,6 @@import sys+import io+from warnings import warnfrom typing import BinaryIO, Any@@ -13,6 +15,14 @@ from .._exceptions import MissingDependencyException, MISSING_DEPENDENCY_MESSAGE_dependency_exc_info = Nonetry:import mammoth+ import mammoth.docx.files++ def mammoth_files_open(self, uri):+ warn("DOCX: processing of r:link resources (e.g., linked images) is disabled.")+ return io.BytesIO(b"")++ mammoth.docx.files.Files.open = mammoth_files_open+except ImportError:# Preserve the error and stack trace for later_dependency_exc_info = sys.exc_info()