Replace single newlines by default

This commit is contained in:
Deniz Şafak
2025-07-06 04:45:34 +03:00
parent 0f025da06b
commit c1fb4541dc
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ _sleep_procs = {"Darwin": None, "Linux": None} # Store sleep prevention process
def clean_text(text, *args, **kwargs):
# Load replace_single_newlines from config
cfg = load_config()
replace_single_newlines = cfg.get("replace_single_newlines", False)
replace_single_newlines = cfg.get("replace_single_newlines", True)
# Collapse all whitespace (excluding newlines) into single spaces per line and trim edges
lines = [re.sub(r"[^\S\n]+", " ", line).strip() for line in text.splitlines()]
text = "\n".join(lines)