MCPcopy Index your code
hub / github.com/vinta/awesome-python / remove_sponsors_section

Function remove_sponsors_section

website/build.py:436–454  ·  view source on GitHub ↗
(markdown: str)

Source from the content-addressed store, hash-verified

434
435
436def 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
457def extract_entries(

Callers

nothing calls this directly

Calls 1

top_level_heading_textFunction · 0.85

Tested by

no test coverage detected