INNER CODE UNIT · Python
extract_heading_value
Steam-Headless/docker-steam-headless · .github/scripts/manage-compatibility-report.py:50
def extract_heading_value(body, heading_names):
if not body:
return None
if isinstance(heading_names, str):
heading_names = [heading_names]
lines = body.splitlines()
targets = [f"### {h.strip().lower()}" for h in heading_names]
in_section = False
section_lines = []
for line in lines:
stripped = line.strip()
if stripped.lower() in targets:
in_section = True
continue
elif in_section and stripped.startswith("### "):
break