From aef04d682ba2da7abfb5cefd6e48c7ce5c88beb9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 18 Feb 2016 18:16:39 +0000 Subject: [PATCH] Make the links we emit for room URLs valid rather than relying on the onClick handler (ie. make them work if you c+p them) --- src/linkify-matrix.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index abb51e85d8..7fb043f800 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -114,6 +114,17 @@ matrixLinkify.options = { } }; } + }, + + formatHref: function (href, type) { + switch (type) { + case 'roomalias': + return '#/room/' + href; + case 'userid': + return '#'; + default: + return href; + } } };