mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Adapt to valid characters for namespace and name
This commit is contained in:
@@ -28,12 +28,13 @@ import { Changeset } from "@scm-manager/ui-types";
|
||||
import { Replacement } from "@scm-manager/ui-components";
|
||||
|
||||
const ChangesetShortLink: (changeset: Changeset, value: string) => Replacement[] = (changeset, value) => {
|
||||
const matches = value.match(/(\w+)\/(\w+)@([a-f0-9]+)/g);
|
||||
const linkRegExp = "([A-Za-z0-9\.\-_]+)\/([A-Za-z0-9\.\-_]+)@([a-f0-9]+)";
|
||||
const matches = value.match(new RegExp(linkRegExp, "g"));
|
||||
if (!matches) {
|
||||
return [];
|
||||
}
|
||||
return matches.map(value => {
|
||||
const groups = value.match(/(\w+)\/(\w+)@([a-f0-9]+)/);
|
||||
const groups = value.match(new RegExp(linkRegExp));
|
||||
const namespace = groups[1];
|
||||
const name = groups[2];
|
||||
const revision = groups[3];
|
||||
|
||||
Reference in New Issue
Block a user