fix: add image notes to DOCX/DOCM import
Some checks failed
Syntax / Linting and Type Checking (push) Has been cancelled
Tests / Linux Python 3.11 (push) Has been cancelled
Tests / Linux Python 3.12 (push) Has been cancelled
Tests / Linux Python 3.13 (push) Has been cancelled
Tests / Linux Python 3.14 (push) Has been cancelled
Tests / Linux Python 3.15 (push) Has been cancelled
Tests / MacOS Python 3.14 (push) Has been cancelled
Tests / Windows Python 3.14 (push) Has been cancelled
Tests / PR Coverage Report (push) Has been cancelled
Tests / Action Coverage Report (push) Has been cancelled
Tests / Ubuntu 24.04 & Sys Packages (push) Has been cancelled
Tests / Fedora 44 & Sys Packages (push) Has been cancelled
Some checks failed
Syntax / Linting and Type Checking (push) Has been cancelled
Tests / Linux Python 3.11 (push) Has been cancelled
Tests / Linux Python 3.12 (push) Has been cancelled
Tests / Linux Python 3.13 (push) Has been cancelled
Tests / Linux Python 3.14 (push) Has been cancelled
Tests / Linux Python 3.15 (push) Has been cancelled
Tests / MacOS Python 3.14 (push) Has been cancelled
Tests / Windows Python 3.14 (push) Has been cancelled
Tests / PR Coverage Report (push) Has been cancelled
Tests / Action Coverage Report (push) Has been cancelled
Tests / Ubuntu 24.04 & Sys Packages (push) Has been cancelled
Tests / Fedora 44 & Sys Packages (push) Has been cancelled
- Add image notes for all images found in the Word document - Images are stored with their binary data and MIME type in the notes
This commit is contained in:
@@ -368,6 +368,17 @@ class FromDocxDocument:
|
||||
)
|
||||
self._result.notes.append(note)
|
||||
|
||||
# Add image notes for images found in the document
|
||||
for img in self._result.images:
|
||||
note = ImportNote(
|
||||
note_type="image",
|
||||
source=f"image file: {img.filename}",
|
||||
text=f"Image: {img.filename}",
|
||||
data=img.data,
|
||||
mime=img.mime,
|
||||
)
|
||||
self._result.notes.append(note)
|
||||
|
||||
def _parse_paragraph(self, para: ET.Element) -> dict | None:
|
||||
"""Parse a single paragraph element and return its content."""
|
||||
# Get paragraph style
|
||||
|
||||
Reference in New Issue
Block a user