File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/markitdown/src/markitdown/converters Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,23 @@ def get_shape_content(shape, **kwargs):
168168
169169 # Group Shapes
170170 if shape .shape_type == pptx .enum .shapes .MSO_SHAPE_TYPE .GROUP :
171- sorted_shapes = sorted (shape .shapes , key = attrgetter ("top" , "left" ))
171+ sorted_shapes = sorted (
172+ shape .shapes ,
173+ key = lambda x : (
174+ float ("-inf" ) if not x .top else x .top ,
175+ float ("-inf" ) if not x .left else x .left ,
176+ ),
177+ )
172178 for subshape in sorted_shapes :
173179 get_shape_content (subshape , ** kwargs )
174180
175- sorted_shapes = sorted (slide .shapes , key = attrgetter ("top" , "left" ))
181+ sorted_shapes = sorted (
182+ slide .shapes ,
183+ key = lambda x : (
184+ float ("-inf" ) if not x .top else x .top ,
185+ float ("-inf" ) if not x .left else x .left ,
186+ ),
187+ )
176188 for shape in sorted_shapes :
177189 get_shape_content (shape , ** kwargs )
178190
You can’t perform that action at this time.
0 commit comments