()
| 157 | skipped_first_h1 = False |
| 158 | |
| 159 | def flush_block() -> None: |
| 160 | if not block: |
| 161 | return |
| 162 | text = "\n".join(block) |
| 163 | block.clear() |
| 164 | if re.search(r"(`[^`]+`|\[[^\]]+]\([^)]+\)|https?://)", text): |
| 165 | out.extend(translate_line(line) for line in text.splitlines()) |
| 166 | else: |
| 167 | translated = translate_text(text) |
| 168 | out.extend(translated.splitlines() if translated else text.splitlines()) |
| 169 | |
| 170 | for line in lines: |
| 171 | if line.startswith("```") or line.startswith("~~~"): |
no test coverage detected