Skip to content

fix(ocr): tolerate None shape and notes text in the PPTX OCR converter - #2402

Open
Lazizbek Ergashev (lazerg) wants to merge 2 commits into
microsoft:mainfrom
lazerg:fix/ocr-pptx-none-text
Open

fix(ocr): tolerate None shape and notes text in the PPTX OCR converter#2402
Lazizbek Ergashev (lazerg) wants to merge 2 commits into
microsoft:mainfrom
lazerg:fix/ocr-pptx-none-text

Conversation

@lazerg

Copy link
Copy Markdown
Contributor

Description

#2059 made PptxConverter tolerate None from shape.text and notes_text_frame.text, but the sibling PptxConverterWithOCR kept the original unguarded concatenation, so the same decks still fail with AttributeError: 'NoneType' object has no attribute 'lstrip' or TypeError: can only concatenate str (not "NoneType") to str once the OCR plugin is enabled.

This applies the same or "" guard at the three sites in packages/markitdown-ocr/src/markitdown_ocr/_pptx_converter_with_ocr.py, and adds two regression tests mirroring the ones #2059 added for the core converter. Both new tests fail on the current code and pass with the fix; the full packages/markitdown-ocr suite is green (43 passed).

Fixes #2398

Check the slide marker and the notes heading instead of a bare
is-not-None, and move the notes deck construction into a helper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OCR PPTX converter still crashes when shape or notes text is None

1 participant