From 72f50a8c61e279829c89ec9264894afd0de8d44d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 19 Jun 2018 11:51:06 +0100 Subject: [PATCH] rewrite group permalinks in also Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/HtmlUtils.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 7ca404be31..4f66468373 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -216,10 +216,16 @@ const sanitizeHtmlParams = { m = attribs.href.match(linkifyMatrix.MATRIXTO_URL_PATTERN); if (m) { const entity = m[1]; - if (entity[0] === '@') { - attribs.href = '#/user/' + entity; - } else if (entity[0] === '#' || entity[0] === '!') { - attribs.href = '#/room/' + entity; + switch (entity[0]) { + case '@': + attribs.href = '#/user/' + entity; + break; + case '+': + attribs.href = '#/group/' + entity; + break; + case '#': case '!': + attribs.href = '#/room/' + entity; + break; } delete attribs.target; }