(markdown: str)
| 434 | |
| 435 | |
| 436 | def remove_sponsors_section(markdown: str) -> str: |
| 437 | lines = markdown.splitlines(keepends=True) |
| 438 | start_idx = None |
| 439 | for i, line in enumerate(lines): |
| 440 | heading = top_level_heading_text(line) |
| 441 | if heading and heading.lower() == "sponsors": |
| 442 | start_idx = i |
| 443 | break |
| 444 | |
| 445 | if start_idx is None: |
| 446 | return markdown |
| 447 | |
| 448 | end_idx = len(lines) |
| 449 | for i, line in enumerate(lines[start_idx + 1 :], start=start_idx + 1): |
| 450 | if top_level_heading_text(line): |
| 451 | end_idx = i |
| 452 | break |
| 453 | |
| 454 | return "".join(lines[:start_idx] + lines[end_idx:]) |
| 455 | |
| 456 | |
| 457 | def extract_entries( |
nothing calls this directly
no test coverage detected