Skip to content

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

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

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.
@afourney

Copy link
Copy Markdown
Member

Thanks for reporting this! This was resolved by #2506 and shipped in 0.1.8. The OCR PPTX converter now inherits the core conversion pipeline, including its handling of None shapes and notes text.

I confirmed that the reported cases reproduce against the older implementation but no longer fail on current  main . Closing as resolved—please reopen if you still encounter this after upgrading  markitdown  and  markitdown-ocr  to 0.1.8 or later.

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

2 participants