diff --git a/README.md b/README.md index 81fb1c6..d0dcb2d 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,8 @@ The available items are the following: You can also give default values for each item. See an example in [customFormatExample.json](customFormatExample.json). +Note that outputting the license text is not recommended with Markdown formatting, as it can be very long and does not work well with Markdown lists. + ## Requiring diff --git a/lib/index.js b/lib/index.js index 6301903..453fc6d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -744,7 +744,7 @@ exports.asMarkDown = function asMarkDown(sorted, customFormat) { if (customFormat && Object.keys(customFormat).length > 0) { Object.keys(sorted).forEach((sortedItem) => { - text.push(` - **[${sortedItem}](${sorted[sortedItem].repository})**`); + text.push(`- **[${sortedItem}](${sorted[sortedItem].repository})**`); Object.keys(customFormat).forEach((customItem) => { text.push(` - ${customItem}: ${sorted[sortedItem][customItem]}`); @@ -753,7 +753,7 @@ exports.asMarkDown = function asMarkDown(sorted, customFormat) { } else { Object.keys(sorted).forEach((key) => { const module = sorted[key]; - text.push(`[${key}](${module.repository}) - ${module.licenses}`); + text.push(`- [${key}](${module.repository}) - ${module.licenses}`); }); } diff --git a/tests/test.js b/tests/test.js index e0ad200..fa7f561 100644 --- a/tests/test.js +++ b/tests/test.js @@ -45,7 +45,7 @@ describe('main tests', function () { it('and convert to MarkDown', function () { const str = checker.asMarkDown(output); - assert.equal(str.split('\n')[0], '[@babel/code-frame@7.16.7](https://github.com/babel/babel) - MIT'); + assert.equal(str.split('\n')[0], '- [@babel/code-frame@7.16.7](https://github.com/babel/babel) - MIT'); }); }); @@ -114,7 +114,7 @@ describe('main tests', function () { }; const str = checker.asMarkDown(output, format); - assert.equal(str.split('\n')[0], ' - **[@babel/code-frame@7.16.7](https://github.com/babel/babel)**'); + assert.equal(str.split('\n')[0], '- **[@babel/code-frame@7.16.7](https://github.com/babel/babel)**'); }); });