rewrite group permalinks in <a hrefs> also
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
1352abf317
commit
72f50a8c61
|
@ -216,10 +216,16 @@ const sanitizeHtmlParams = {
|
||||||
m = attribs.href.match(linkifyMatrix.MATRIXTO_URL_PATTERN);
|
m = attribs.href.match(linkifyMatrix.MATRIXTO_URL_PATTERN);
|
||||||
if (m) {
|
if (m) {
|
||||||
const entity = m[1];
|
const entity = m[1];
|
||||||
if (entity[0] === '@') {
|
switch (entity[0]) {
|
||||||
|
case '@':
|
||||||
attribs.href = '#/user/' + entity;
|
attribs.href = '#/user/' + entity;
|
||||||
} else if (entity[0] === '#' || entity[0] === '!') {
|
break;
|
||||||
|
case '+':
|
||||||
|
attribs.href = '#/group/' + entity;
|
||||||
|
break;
|
||||||
|
case '#': case '!':
|
||||||
attribs.href = '#/room/' + entity;
|
attribs.href = '#/room/' + entity;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
delete attribs.target;
|
delete attribs.target;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue