Fixed changelog issue links.

This commit is contained in:
Richard Moore 2019-06-11 17:56:33 -04:00
parent 1bc792d9dc
commit deb2281af2
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295

View File

@ -68,16 +68,16 @@ async function generate() {
changes.forEach((change) => {
let body = change.body.trim();
let link = body.match(/(\((.*#.*)\))/)
let commit = `[${change.commit.substring(0, 7)}](https://github.com/ethers-io/ethers.js/commit/${change.commit})`;
let commit = `[${ change.commit.substring(0, 7) }](https://github.com/ethers-io/ethers.js/commit/${ change.commit })`;
if (link) {
body = body.replace(/ *(\(.*#.*)\) */, "");
link = link[2].replace(/#([0-9]+)/g, (issue) => {
return `[#${issue}](https://github.com/ethers-io/ethers.js/issues/ + issue)`;
link = link[2].replace(/#([0-9]+)/g, (all, issue) => {
return `[#${ issue }](https://github.com/ethers-io/ethers.js/issues/${ issue })`;
}) + "; " + commit;
} else {
link = commit;
}
newSection.body.push(` - ${body} (${link})`);
newSection.body.push(` - ${ body } (${ link })`);
});
sections.splice(1, 0, newSection);