fix(ocr): tolerate None shape and notes text in the PPTX OCR converter - #2402
Open
Lazizbek Ergashev (lazerg) wants to merge 2 commits into
Open
fix(ocr): tolerate None shape and notes text in the PPTX OCR converter#2402Lazizbek Ergashev (lazerg) wants to merge 2 commits into
Lazizbek Ergashev (lazerg) wants to merge 2 commits into
Conversation
Check the slide marker and the notes heading instead of a bare is-not-None, and move the notes deck construction into a helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#2059 made
PptxConvertertolerateNonefromshape.textandnotes_text_frame.text, but the siblingPptxConverterWithOCRkept the original unguarded concatenation, so the same decks still fail withAttributeError: 'NoneType' object has no attribute 'lstrip'orTypeError: can only concatenate str (not "NoneType") to stronce the OCR plugin is enabled.This applies the same
or ""guard at the three sites inpackages/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 fullpackages/markitdown-ocrsuite is green (43 passed).Fixes #2398