MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / subsection_body

Function subsection_body

scripts/lint_note.py:1242–1254  ·  view source on GitHub ↗
(text: str, section_heading: str, subsection_heading: str)

Source from the content-addressed store, hash-verified

1240
1241
1242def subsection_body(text: str, section_heading: str, subsection_heading: str) -> str:
1243 body = section_body(text, section_heading)
1244 if not body:
1245 return ""
1246 pattern = rf"^###\s+{re.escape(subsection_heading)}\s*$"
1247 match = re.search(pattern, body, flags=re.MULTILINE)
1248 if not match:
1249 return ""
1250 start = match.end()
1251 next_match = re.search(r"^(?:##|###)\s+.+$", body[start:], flags=re.MULTILINE)
1252 if not next_match:
1253 return body[start:]
1254 return body[start : start + next_match.start()]
1255
1256
1257def cleaned_section_lines(body: str) -> list[str]:

Callers 1

mechanism_flow_warningsFunction · 0.85

Calls 1

section_bodyFunction · 0.85

Tested by

no test coverage detected