From 1339655d233b96a02680a08715ba61ea96d12d5e Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Sat, 17 Aug 2024 09:25:36 -0400 Subject: [PATCH 1/3] fix(regex): accepting numbers in name --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index d84795f..9a135ed 100644 --- a/lib/index.js +++ b/lib/index.js @@ -135,7 +135,7 @@ const minShaLength = 7 // cannot begin or end with a hyphen*. // // \* That is: until . -const userGroup = '[\\da-z][-\\da-z]{0,38}' +const userGroup = '[\\da-z][-\\da-z0-9]{0,38}' const projectGroup = '(?:\\.git[\\w-]|\\.(?!git)|[\\w-])+' const repoGroup = '(' + userGroup + ')\\/(' + projectGroup + ')' From 3f879877c568a5a16e844436b6f976c9b228ec5f Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Sat, 17 Aug 2024 09:32:51 -0400 Subject: [PATCH 2/3] test: add input.md --- test/fixtures/mention/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/mention/input.md b/test/fixtures/mention/input.md index 599ecbd..754535a 100644 --- a/test/fixtures/mention/input.md +++ b/test/fixtures/mention/input.md @@ -6,7 +6,7 @@ For example, @user, @organization, or @organization/team-name. GitHub ignores @mention and @mentions. -Some valid real world examples: @a, @github, @github/security, @dependabot[bot]. +Some valid real world examples: @a, @github, @github/security, @dependabot[bot], @myname0. But this is invalid: @-w. From 5f05860f96ac016b7d3186d8ec2bbc4653f15aed Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Sat, 17 Aug 2024 09:33:26 -0400 Subject: [PATCH 3/3] Update output.md --- test/fixtures/mention/output.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/mention/output.md b/test/fixtures/mention/output.md index d946c71..e50dafd 100644 --- a/test/fixtures/mention/output.md +++ b/test/fixtures/mention/output.md @@ -6,7 +6,7 @@ For example, [**@user**](https://github.com/user), [**@organization**](https://g GitHub ignores @mention and @mentions. -Some valid real world examples: [**@a**](https://github.com/a), [**@github**](https://github.com/github), [**@github/security**](https://github.com/github/security), [**@dependabot**](https://github.com/dependabot)\[bot]. +Some valid real world examples: [**@a**](https://github.com/a), [**@github**](https://github.com/github), [**@github/security**](https://github.com/github/security), [**@dependabot**](https://github.com/dependabot)\[bot], [**@myname0**](https://github.com/myname0). But this is invalid: @-w.