From 8fd176829d79bf9d43562080ccffee92d1b8f91a Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Thu, 14 Feb 2019 22:16:17 +0100 Subject: [PATCH] fix: github username detection (#26) Applied my patch from https://github.com/conventional-changelog/conventional-changelog/pull/394 --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 53ea4e3..fe11a13 100644 --- a/index.js +++ b/index.js @@ -78,7 +78,13 @@ function releaseNotesGeneratorTransform(commit, context) { } if (context.host) { // User URLs. - commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9]){0,38})/g, `[@$1](${context.host}/$1)`); + commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => { + if (username.includes('/')) { + return `@${username}` + } + + return `[@${username}](${context.host}/${username})` + }); } }