changelogen
changelogen copied to clipboard
extra space in Contributors title
Environment
node: 18.16.0
changelogen: 0.5.3
Reproduction
https://github.com/unjs/changelogen/blob/main/CHANGELOG.md?plain=1
Describe the bug
latest version will generate extra useless space between ❤️ and Contributors.
And there are some other format issue:
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:
Additional context
No response
Logs
No response
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.
It's a good point for that extra space in the Contributors title. That's also the case for the "Breaking Changes" one.
- seems will be auto trimed by prettier
- the extra space will not be renderer