diff --git a/.gitignore b/.gitignore index ab4f4cb..22b6454 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ package-lock.json yarn.lock .vscode cache +.idea diff --git a/.nvmrc b/.nvmrc index 2a5dd0d..894aa0b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -8.14.0 +8.16.0 diff --git a/src/generate/__tests__/index.js b/src/generate/__tests__/index.js index c75a883..5a8e3a1 100644 --- a/src/generate/__tests__/index.js +++ b/src/generate/__tests__/index.js @@ -143,9 +143,9 @@ test('replace all-contributors badge if present', () => { 'Badges', [ '[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)', - '', - '[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)', - '', + '\n', + '[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)\n', + '\n', '[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)', ].join(''), '', @@ -157,9 +157,9 @@ test('replace all-contributors badge if present', () => { 'Badges', [ '[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)', - '', - '[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)', - '', + '\n', + '[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n', + '\n', '[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)', ].join(''), '', diff --git a/src/generate/index.js b/src/generate/index.js index 3a2c899..9112535 100644 --- a/src/generate/index.js +++ b/src/generate/index.js @@ -81,7 +81,9 @@ function replaceBadge(newContent) { } return [ previousContent.slice(0, endOfOpeningTagIndex + closingTag.length), + '\n', newContent, + '\n', previousContent.slice(startOfClosingTagIndex), ].join('') }