From 57a5188196172e235185e683a9d6663356fe561d Mon Sep 17 00:00:00 2001 From: Mark Eaton Date: Sat, 10 Jan 2026 21:56:40 -0500 Subject: [PATCH] fix last line displaying newline character --- scripts/language_stats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/language_stats.py b/scripts/language_stats.py index ec6efd0..6c4b0f8 100644 --- a/scripts/language_stats.py +++ b/scripts/language_stats.py @@ -181,9 +181,10 @@ def generate_markdown(totals: dict[str, int]) -> str: for lang, nbytes in pairs: pct = nbytes * 100 / total_bytes bar = "█" * int(pct / 2) # up to 50 chars - lines.append(f"{bar} {lang}{pct:5.1f}%\\") + lines.append(f"{bar} {lang}{pct:5.1f}%") - return "\n".join(lines) + # Join with backslash + newline for markdown line breaks (except after last line) + return "\\\n".join(lines) def fetch_readme(session: requests.Session) -> tuple[str, str]: