changelogen icon indicating copy to clipboard operation
changelogen copied to clipboard

extra space in Contributors title

Open tjx666 opened this issue 2 years ago • 2 comments

Environment

node: 18.16.0
changelogen: 0.5.3

Reproduction

https://github.com/unjs/changelogen/blob/main/CHANGELOG.md?plain=1

image

Describe the bug

latest version will generate extra useless space between ❤️ and Contributors.

And there are some other format issue:

image

following is the fix in my package:

let md = await generateMarkDown(commits, config);
// remove extra empty lines
md = md.replaceAll('\n\n\n', '\n\n');

// remove extra list indent
md = md.replaceAll('  - ', '- ');

// move compare changes part to bottom position
const compareChanges = md
    .split('\n')
    .map((line) => line.trim())
    .filter((line) => line !== '')
    .find((line) => line.startsWith('[compare changes]('))!
    .replace('compare changes', 'View changes on GitHub');
md = md.replace(`${compareChanges}\n\n`, '');
md += `\n\n${compareChanges}`;

I also find that prettier will do following fix:

image

Additional context

No response

Logs

No response

tjx666 avatar Jul 03 '23 04:07 tjx666

v0.5.4 has resolved the two red arrows in your second screenshot.

It's a good point for that extra space in the Contributors title. That's also the case for the "Breaking Changes" one.

tmlmt avatar Jul 03 '23 22:07 tmlmt

It's a good point for that extra space in the Contributors title. That's also the case for the "Breaking Changes" one.

  1. seems will be auto trimed by prettier
  2. the extra space will not be renderer

tjx666 avatar Jul 08 '23 18:07 tjx666