779a18f56e
JS regex has no \z anchor — it matched a literal 'z', so appending to the last section under [Unreleased] silently failed and duplicated the heading. Use $(?![\s\S]) to anchor to true end-of-input.