Skip to content

feat: sort pptx shapes to be parsed in top-to-bottom, left-to-right order - #1104

Merged
Adam Fourney (afourney) merged 4 commits into
microsoft:mainfrom
richardye101:patch-2
Mar 7, 2025
Merged

Adam Fourney (afourney) merged 4 commits into
microsoft:mainfrom
richardye101:patch-2

Conversation

@richardye101

@richardye101 Richard Ye (richardye101) commented Mar 7, 2025 •

Copy link
Copy Markdown
Contributor

Currently, markitdown parses pptx shapes in Z-order, the order in which shapes are stacked on top of each other starting from the back to the front.

There are repos that parse pptx to markdown which read the shapes in a normal reading order (top-to-bottom, left-to-right order) like https://github.com/ssine/pptx2md/blob/39bef65b312035baeade932aad8d221e37daae5f/pptx2md/parser.py#L249.

There are also stackoverflow posts that explain how to implement this code: https://stackoverflow.com/questions/51999656/how-to-extract-text-from-powerpoint-text-boxes-in-their-order-within-the-presen

I've simply copied over what sine (@ssine) has created in his repo, as it's the cleanest implementation.

@richardye101

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@afourney

Adam Fourney (afourney) commented Mar 7, 2025 •

Copy link
Copy Markdown
Member

It appears that attrgetter is not included.

@afourney

Copy link
Copy Markdown
Member

Thanks! Nice and simple fix.

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.

2 participants