@@ -1284,8 +1284,8 @@ def export_to_markdown( # noqa: C901
12841284 ) -> str :
12851285 r"""Serialize to Markdown.
12861286
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 .
12891289
12901290 :param delim: Delimiter to use when concatenating the various
12911291 Markdown parts. Defaults to "\n\n".
@@ -1294,19 +1294,16 @@ def export_to_markdown( # noqa: C901
12941294 Defaults to 0.
12951295 :type from_element: int
12961296 :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
12991299 :param delim: str: (Default value = "\n\n")
1300- :param from_element: int: (Default value = 0)
1301- :param to_element: Optional[int]: (Default value = None)
13021300 :param labels: set[DocItemLabel]
13031301 :param "subtitle-level-1":
13041302 :param "paragraph":
13051303 :param "caption":
13061304 :param "table":
13071305 :param "Text":
13081306 :param "text":
1309- :param ]:
13101307 :param strict_text: bool: (Default value = False)
13111308 :param image_placeholder str: (Default value = "<!-- image -->")
13121309 the placeholder to include to position images in the markdown.
@@ -1331,7 +1328,7 @@ def export_to_markdown( # noqa: C901
13311328
13321329 previous_level = level # Update previous_level for next iteration
13331330
1334- if ix < from_element and to_element <= ix :
1331+ if ix < from_element or to_element <= ix :
13351332 continue # skip as many items as you want
13361333
13371334 # Handle newlines between different types of content
0 commit comments