diff --git a/packages/markitdown/src/markitdown/converters/_pptx_converter.py b/packages/markitdown/src/markitdown/converters/_pptx_converter.py index bea1226..da81f75 100644 --- a/packages/markitdown/src/markitdown/converters/_pptx_converter.py +++ b/packages/markitdown/src/markitdown/converters/_pptx_converter.py @@ -160,10 +160,12 @@ class PptxConverter(DocumentConverter): # Group Shapes if shape.shape_type == pptx.enum.shapes.MSO_SHAPE_TYPE.GROUP: - for subshape in shape.shapes: + sorted_shapes = sorted(shape.shapes, key=attrgetter('top', 'left')) + for subshape in sorted_shapes: get_shape_content(subshape, **kwargs) - - for shape in slide.shapes: + + sorted_shapes = sorted(slide.shapes, key=attrgetter('top', 'left')) + for shape in sorted_shapes: get_shape_content(shape, **kwargs) md_content = md_content.strip()