fix last line displaying newline character

This commit is contained in:
Mark Eaton
2026-01-10 21:56:40 -05:00
parent c40df69f9e
commit 57a5188196
+3 -2
View File
@@ -181,9 +181,10 @@ def generate_markdown(totals: dict[str, int]) -> str:
for lang, nbytes in pairs: for lang, nbytes in pairs:
pct = nbytes * 100 / total_bytes pct = nbytes * 100 / total_bytes
bar = "" * int(pct / 2) # up to 50 chars 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]: def fetch_readme(session: requests.Session) -> tuple[str, str]: