Extract lines between a section header and the next section header.
(lines: list[str], section_name: str)
| 70 | |
| 71 | |
| 72 | def _extract_section(lines: list[str], section_name: str) -> list[str]: |
| 73 | """Extract lines between a section header and the next section header.""" |
| 74 | result: list[str] = [] |
| 75 | in_section = False |
| 76 | for line in lines: |
| 77 | if in_section: |
| 78 | if _is_any_section_header(line): |
| 79 | break |
| 80 | result.append(line) |
| 81 | elif _is_section_header(line, section_name): |
| 82 | in_section = True |
| 83 | return result |
| 84 | |
| 85 | |
| 86 | # Matches "command" as a standalone word, case-insensitive |
no test coverage detected