Make identifier regexes closer to the spec
This commit is contained in:
parent
75476bce86
commit
78f8bfb45d
1 changed files with 5 additions and 5 deletions
|
@ -16,13 +16,13 @@ import {
|
||||||
*/
|
*/
|
||||||
type Verifier<A> = [RegExp, A];
|
type Verifier<A> = [RegExp, A];
|
||||||
export const roomVerifiers: Verifier<LinkKind.Alias | LinkKind.RoomId>[] = [
|
export const roomVerifiers: Verifier<LinkKind.Alias | LinkKind.RoomId>[] = [
|
||||||
[/^#([^/:]+?):(.+)$/, LinkKind.Alias],
|
[/^#([^:]*):(.+)$/, LinkKind.Alias],
|
||||||
[/^!([^/:]+?):(.+)$/, LinkKind.RoomId],
|
[/^!([^:]*):(.+)$/, LinkKind.RoomId],
|
||||||
];
|
];
|
||||||
export const verifiers: Verifier<LinkKind>[] = [
|
export const verifiers: Verifier<LinkKind>[] = [
|
||||||
[/^[!#]([^/:]+?):(.+?)\/\$([^/:]+?)$/, LinkKind.Permalink],
|
[/^[!#]([^:]*):(.+)\/\$([^:]+):(.+)$/, LinkKind.Permalink],
|
||||||
[/^@([^/:]+?):(.+)$/, LinkKind.UserId],
|
[/^@([^:]+):(.+)$/, LinkKind.UserId],
|
||||||
[/^\+([^/:]+?):(.+)$/, LinkKind.GroupId],
|
[/^\+([^:]+):(.+)$/, LinkKind.GroupId],
|
||||||
...roomVerifiers,
|
...roomVerifiers,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue