MCPcopy Index your code
hub / github.com/crisxuan/bestJavaer / flush_block

Function flush_block

scripts/generate_english_articles.py:159–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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("~~~"):

Callers 1

translate_markdownFunction · 0.85

Calls 2

translate_lineFunction · 0.85
translate_textFunction · 0.70

Tested by

no test coverage detected