@@ -1284,8 +1284,8 @@ def export_to_markdown( # noqa: C901
1284
1284
) -> str :
1285
1285
r"""Serialize to Markdown.
1286
1286
1287
- Operates on a slice of the document's main_text as defined through arguments
1288
- main_text_start and main_text_stop ; defaulting to the whole main_text .
1287
+ Operates on a slice of the document's body as defined through arguments
1288
+ from_element and to_element ; defaulting to the whole document .
1289
1289
1290
1290
:param delim: Delimiter to use when concatenating the various
1291
1291
Markdown parts. Defaults to "\n\n".
@@ -1294,19 +1294,16 @@ def export_to_markdown( # noqa: C901
1294
1294
Defaults to 0.
1295
1295
:type from_element: int
1296
1296
:param to_element: Body slicing stop index
1297
- (exclusive). Defaults to None .
1298
- :type to_element: Optional[ int]
1297
+ (exclusive). Defaults to 0maxint .
1298
+ :type to_element: int
1299
1299
:param delim: str: (Default value = "\n\n")
1300
- :param from_element: int: (Default value = 0)
1301
- :param to_element: Optional[int]: (Default value = None)
1302
1300
:param labels: set[DocItemLabel]
1303
1301
:param "subtitle-level-1":
1304
1302
:param "paragraph":
1305
1303
:param "caption":
1306
1304
:param "table":
1307
1305
:param "Text":
1308
1306
:param "text":
1309
- :param ]:
1310
1307
:param strict_text: bool: (Default value = False)
1311
1308
:param image_placeholder str: (Default value = "<!-- image -->")
1312
1309
the placeholder to include to position images in the markdown.
@@ -1331,7 +1328,7 @@ def export_to_markdown( # noqa: C901
1331
1328
1332
1329
previous_level = level # Update previous_level for next iteration
1333
1330
1334
- if ix < from_element and to_element <= ix :
1331
+ if ix < from_element or to_element <= ix :
1335
1332
continue # skip as many items as you want
1336
1333
1337
1334
# Handle newlines between different types of content
0 commit comments