diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 43b7cfb8..4b01d377 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -74,7 +74,6 @@ export default defineThemeUnconfig({ { name: 'Northword', username: 'northword', - mapByNameAliases: ['northword'], }, ], }, diff --git a/packages/vitepress-plugin-git-changelog/src/client/composables/author.ts b/packages/vitepress-plugin-git-changelog/src/client/composables/author.ts index 84f625b8..b14fa07b 100644 --- a/packages/vitepress-plugin-git-changelog/src/client/composables/author.ts +++ b/packages/vitepress-plugin-git-changelog/src/client/composables/author.ts @@ -74,9 +74,9 @@ export async function extractAuthorsWithMultiple( while (result = multipleAuthorsRegex.exec(c.body)) { const [, name, email] = result await mapCommitAuthors(mapContributors, map, { - author_name: name, - author_email: email, - author_avatar: await digestStringAsSHA256(email), + author_name: name.trim(), + author_email: email.trim(), + author_avatar: await digestStringAsSHA256(email.trim()), }) } } diff --git a/packages/vitepress-plugin-git-changelog/src/vite/helpers.test.ts b/packages/vitepress-plugin-git-changelog/src/vite/helpers.test.ts index 3ff95db6..d5c1e228 100644 --- a/packages/vitepress-plugin-git-changelog/src/vite/helpers.test.ts +++ b/packages/vitepress-plugin-git-changelog/src/vite/helpers.test.ts @@ -107,7 +107,7 @@ describe('parseCommits', () => { date: 'Mon Mar 25 20:05:53 2024 +0800', date_timestamp: 1711368353000, message: 'release: v1.24.3', - body: 'Signed-off-by: First Last \n', + body: 'Signed-off-by: First Last ', author_name: 'First Last', author_email: 'user@example.com', author_avatar: 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514', @@ -133,7 +133,7 @@ describe('parseCommits', () => { date: 'Wed Apr 24 14:24:44 2024 +0800', date_timestamp: 1713939884000, message: 'docs: fix english integrations list', - body: 'Signed-off-by: First Last \n', + body: 'Signed-off-by: First Last ', author_name: 'First Last', author_email: 'user@example.com', author_avatar: 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514', diff --git a/packages/vitepress-plugin-git-changelog/src/vite/helpers.ts b/packages/vitepress-plugin-git-changelog/src/vite/helpers.ts index 8c1052f4..262fa2a8 100644 --- a/packages/vitepress-plugin-git-changelog/src/vite/helpers.ts +++ b/packages/vitepress-plugin-git-changelog/src/vite/helpers.ts @@ -265,7 +265,7 @@ export async function parseCommits( optsRewritePathsBy?: RewritePathsBy, ): Promise { const commits = await Promise.all(rawLogs.map(async (raw) => { - const [hash, author_name, author_email, date, message, refs, body] = raw.split('|') + const [hash, author_name, author_email, date, message, refs, body] = raw.split('|').map(v => v.trim()) const commit: Commit = { path, hash,