From dff79c4688d46633a33c32edc954e0e88d67fac9 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 27 Jul 2017 13:01:40 +0100 Subject: [PATCH] Only apply room pills to matrix.to room links, exclude event links This fixes https://github.com/vector-im/riot-web/issues/4680 and fixes https://github.com/vector-im/riot-web/issues/4670 --- src/components/views/elements/Pill.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index ade7e6ea5c..6249863938 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -25,8 +25,8 @@ import { getDisplayAliasForRoom } from '../../../Rooms'; const REGEX_MATRIXTO = new RegExp(MATRIXTO_URL_PATTERN); // For URLs of matrix.to links in the timeline which have been reformatted by -// HttpUtils transformTags to relative links -const REGEX_LOCAL_MATRIXTO = /^#\/(?:user|room)\/(([\#\!\@\+]).*)$/; +// HttpUtils transformTags to relative links. This excludes event URLs (with `[^\/]*`) +const REGEX_LOCAL_MATRIXTO = /^#\/(?:user|room)\/(([\#\!\@\+])[^\/]*)$/; const Pill = React.createClass({ statics: {