MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / collapse_blank_lines

Function collapse_blank_lines

scripts/postprocess_fulltext.py:429–431  ·  view source on GitHub ↗

Replace 3+ consecutive blank lines with 2.

(content: str)

Source from the content-addressed store, hash-verified

427# ── collapse excess blank lines ───────────────────────────────────────────────
428
429def collapse_blank_lines(content: str) -> str:
430 """Replace 3+ consecutive blank lines with 2."""
431 return re.sub(r'\n{4,}', '\n\n\n', content)
432
433
434# ── repeated header/footer and cover image cleanup ───────────────────────────

Callers 1

process_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected