Returns (level, title) if line is a header, else (0, "").
(line: str)
| 185 | |
| 186 | |
| 187 | def _parse_header(line: str) -> Tuple[int, str]: |
| 188 | """Returns (level, title) if line is a header, else (0, "").""" |
| 189 | match = re.match(r"^(#+)\s+(.+)$", line) |
| 190 | if match: |
| 191 | return len(match.group(1)), match.group(2).strip() |
| 192 | return 0, "" |
| 193 | |
| 194 | |
| 195 | def _find_chapter_range(lines: List[str], title_path: str) -> Tuple[int, int]: |
no outgoing calls
no test coverage detected