Skip to content

Commit

Permalink
fix: github username detection (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal authored Feb 14, 2019
1 parent 0aca0d6 commit 8fd1768
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`
});
}
}

Expand Down

0 comments on commit 8fd1768

Please sign in to comment.