(text: str, heading: str)
| 1228 | |
| 1229 | |
| 1230 | def section_body(text: str, heading: str) -> str: |
| 1231 | pattern = rf"^##\s+{re.escape(heading)}\s*$" |
| 1232 | match = re.search(pattern, text, flags=re.MULTILINE) |
| 1233 | if not match: |
| 1234 | return "" |
| 1235 | start = match.end() |
| 1236 | next_match = re.search(r"^##\s+.+$", text[start:], flags=re.MULTILINE) |
| 1237 | if not next_match: |
| 1238 | return text[start:] |
| 1239 | return text[start : start + next_match.start()] |
| 1240 | |
| 1241 | |
| 1242 | def subsection_body(text: str, section_heading: str, subsection_heading: str) -> str: |
no outgoing calls
no test coverage detected