lib/pimpmychangelog/pimper.rb in pimpmychangelog-0.1.1 vs lib/pimpmychangelog/pimper.rb in pimpmychangelog-0.1.2
- old
+ new
@@ -16,10 +16,14 @@
# @return [String] The changelog with contributors and issues as link
def better_changelog
parsed_changelog = Parser.new(changelog)
- linkify_changelog(parsed_changelog.content) +
+ # If the file doesn't have an extra newline at the end the separator gets rendered
+ # as part of the changelog. So add an extra newline in that case.
+ extra_newline_if_required = parsed_changelog.content.match(/\n\n\Z/) ? "" : "\n"
+
+ linkify_changelog(parsed_changelog.content) + extra_newline_if_required +
links_definitions(parsed_changelog.issues, parsed_changelog.contributors)
end
protected