actually, only intercept URLs which are explicitly referring to our current app

This commit is contained in:
Matthew Hodgson 2016-03-20 12:31:30 +00:00
parent 1aed9ccbf4
commit d54a75c913
2 changed files with 10 additions and 8 deletions

View file

@ -47,10 +47,9 @@ var sanitizeHtmlParams = {
transformTags: { // custom to matrix
// add blank targets to all hyperlinks except vector URLs
'a': function(tagName, attribs) {
// XXX: use matrix.to instead and deduplicate regexp with linkify-matrix.js
var m = attribs.href.match(linkifyMatrix.VECTOR_URL_PATTERN);
if (m) {
return { tagName: 'a', attribs: { href: m[4] } };
return { tagName: 'a', attribs: { href: attribs.href } };
}
else {
return { tagName: 'a', attribs: { href: attribs.href, target: '_blank'} };