Kill the mutant that strips more than blank lines off a changelog with no section

This commit is contained in:
Lilleman
2026-11-24 14:48:06 +01:00
parent 39cb2f4d9e
commit 3f74d32cae
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ def headed(changelog: str, entries: list[str], named: str) -> str:
added = f"## {named}\n\n" + "\n".join(entries) + "\n"
first = re.search(r"^## ", changelog, flags=re.M)
if first is None:
return changelog.rstrip("\n") + "\n\n" + added
return changelog.rstrip() + "\n\n" + added
return changelog[:first.start()] + added + "\n" + changelog[first.start():]