Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add username links in CHANGELOG.md #4204

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

## What's Changed
### Bug Fixes 🛠
* Fix typing errors for Quill.register by @hzgotb in https://github.com/quilljs/quill/pull/4127
* Fix event source when deleting a link with shortcuts by @luin in https://github.com/quilljs/quill/pull/4200
* Avoid side effects for Enter/Backspace when composing in Safari by @luin in https://github.com/quilljs/quill/pull/4201
* Ignore pasting images when image format is disallowed by @luin in https://github.com/quilljs/quill/pull/4202
* Fix typing errors for Quill.register by [@hzgotb](https://github.com/hzgotb) in https://github.com/quilljs/quill/pull/4127
* Fix event source when deleting a link with shortcuts by [@luin](https://github.com/luin) in https://github.com/quilljs/quill/pull/4200
* Avoid side effects for Enter/Backspace when composing in Safari by [@luin](https://github.com/luin) in https://github.com/quilljs/quill/pull/4201
* Ignore pasting images when image format is disallowed by [@luin](https://github.com/luin) in https://github.com/quilljs/quill/pull/4202

[All changes](https://github.com/quilljs/quill/releases/tag/v2.0.2)

Expand Down
11 changes: 8 additions & 3 deletions scripts/changelog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (currentChangeLog.includes(`# ${release.tagName}`)) {

await configGit();

const filteredReleaseNote = (note) => {
const normalizeReleaseNote = (note) => {
const ignoreSections = [
"## new contributors",
"## all changes",
Expand All @@ -41,7 +41,12 @@ const filteredReleaseNote = (note) => {
note = note.slice(0, index).replace(/#\s*$/, "");
}
});
return note.trim();

return note
.replace(/by @([-\w]+)/g, (_, username) => {
return `by [@${username}](https://github.com/${username})`;
})
.trim();
};

const formatDate = (date) => {
Expand All @@ -53,7 +58,7 @@ const { body } = JSON.parse(
(await $`gh release view ${release.tagName} --json=body`).stdout
);

const note = `# ${release.tagName} (${formatDate(new Date(release.publishedAt))})\n\n${filteredReleaseNote(body)}\n\n[All changes](https://github.com/quilljs/quill/releases/tag/${release.tagName})\n`;
const note = `# ${release.tagName} (${formatDate(new Date(release.publishedAt))})\n\n${normalizeReleaseNote(body)}\n\n[All changes](https://github.com/quilljs/quill/releases/tag/${release.tagName})\n`;

await writeFile(changeLogFilePath, `${note}\n${currentChangeLog}`);

Expand Down
Loading