You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
incorporate review
This commit is contained in:
@@ -47,12 +47,12 @@ var sanitizeHtmlParams = {
|
||||
transformTags: { // custom to matrix
|
||||
// add blank targets to all hyperlinks except vector URLs
|
||||
'a': function(tagName, attribs) {
|
||||
var m = attribs.href.match(linkifyMatrix.VECTOR_URL_PATTERN);
|
||||
var m = attribs.href ? attribs.href.match(linkifyMatrix.VECTOR_URL_PATTERN) : null;
|
||||
if (m) {
|
||||
return { tagName: 'a', attribs: { href: attribs.href } };
|
||||
return { tagName: 'a', attribs: { href: attribs.href, name: attribs.name } };
|
||||
}
|
||||
else {
|
||||
return { tagName: 'a', attribs: { href: attribs.href, target: '_blank'} };
|
||||
return { tagName: 'a', attribs: { href: attribs.href, name: attribs.name, target: '_blank' } };
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user