(line: str)
| 1728 | |
| 1729 | |
| 1730 | def match_section_heading(line: str) -> str | None: |
| 1731 | normalized = normalize_heading(line) |
| 1732 | if not normalized: |
| 1733 | return None |
| 1734 | if normalized in STOP_SECTION_ALIASES: |
| 1735 | return "stop" |
| 1736 | for section, aliases in SECTION_ALIASES.items(): |
| 1737 | if normalized in aliases: |
| 1738 | return section |
| 1739 | return None |
| 1740 | |
| 1741 | |
| 1742 | def stop_section_reason(line: str, *, allow_prefix: bool = False) -> str: |