mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
optimize linkify-matrix by skipping an intermediary state
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
09b09846cf
commit
9f3a121abc
1 changed files with 3 additions and 9 deletions
|
@ -35,7 +35,7 @@ function matrixLinkify(linkify) {
|
|||
};
|
||||
ROOMALIAS.prototype = new MultiToken();
|
||||
|
||||
const S_HASH = new linkify.parser.State();
|
||||
const S_HASH = S_START.jump(TT.POUND);
|
||||
const S_HASH_NAME = new linkify.parser.State();
|
||||
const S_HASH_NAME_COLON = new linkify.parser.State();
|
||||
const S_HASH_NAME_COLON_DOMAIN = new linkify.parser.State();
|
||||
|
@ -57,8 +57,6 @@ function matrixLinkify(linkify) {
|
|||
TT.LOCALHOST,
|
||||
];
|
||||
|
||||
S_START.on(TT.POUND, S_HASH);
|
||||
|
||||
S_HASH.on(roomname_tokens, S_HASH_NAME);
|
||||
S_HASH_NAME.on(roomname_tokens, S_HASH_NAME);
|
||||
S_HASH_NAME.on(TT.DOMAIN, S_HASH_NAME);
|
||||
|
@ -84,7 +82,7 @@ function matrixLinkify(linkify) {
|
|||
};
|
||||
USERID.prototype = new MultiToken();
|
||||
|
||||
const S_AT = new linkify.parser.State();
|
||||
const S_AT = S_START.jump(TT.AT);
|
||||
const S_AT_NAME = new linkify.parser.State();
|
||||
const S_AT_NAME_COLON = new linkify.parser.State();
|
||||
const S_AT_NAME_COLON_DOMAIN = new linkify.parser.State();
|
||||
|
@ -104,8 +102,6 @@ function matrixLinkify(linkify) {
|
|||
TT.LOCALHOST,
|
||||
];
|
||||
|
||||
S_START.on(TT.AT, S_AT);
|
||||
|
||||
S_AT.on(username_tokens, S_AT_NAME);
|
||||
S_AT_NAME.on(username_tokens, S_AT_NAME);
|
||||
S_AT_NAME.on(TT.DOMAIN, S_AT_NAME);
|
||||
|
@ -131,7 +127,7 @@ function matrixLinkify(linkify) {
|
|||
};
|
||||
GROUPID.prototype = new MultiToken();
|
||||
|
||||
const S_PLUS = new linkify.parser.State();
|
||||
const S_PLUS = S_START.jump(TT.PLUS);
|
||||
const S_PLUS_NAME = new linkify.parser.State();
|
||||
const S_PLUS_NAME_COLON = new linkify.parser.State();
|
||||
const S_PLUS_NAME_COLON_DOMAIN = new linkify.parser.State();
|
||||
|
@ -151,8 +147,6 @@ function matrixLinkify(linkify) {
|
|||
TT.LOCALHOST,
|
||||
];
|
||||
|
||||
S_START.on(TT.PLUS, S_PLUS);
|
||||
|
||||
S_PLUS.on(groupid_tokens, S_PLUS_NAME);
|
||||
S_PLUS_NAME.on(groupid_tokens, S_PLUS_NAME);
|
||||
S_PLUS_NAME.on(TT.DOMAIN, S_PLUS_NAME);
|
||||
|
|
Loading…
Reference in a new issue