mirror of
https://github.com/element-hq/element-web
synced 2024-10-26 12:45:53 +03:00
Don't do URL previews for matrix.to
This commit is contained in:
parent
b86f9f362a
commit
2bb7aec0de
1 changed files with 6 additions and 0 deletions
|
@ -162,6 +162,12 @@ module.exports = React.createClass({
|
||||||
else {
|
else {
|
||||||
var url = node.getAttribute("href");
|
var url = node.getAttribute("href");
|
||||||
var host = url.match(/^https?:\/\/(.*?)(\/|$)/)[1];
|
var host = url.match(/^https?:\/\/(.*?)(\/|$)/)[1];
|
||||||
|
|
||||||
|
// never preview matrix.to links (if anything we should give a smart
|
||||||
|
// preview of the room/user they point to: nobody needs to be reminded
|
||||||
|
// what the matrix.to site looks like).
|
||||||
|
if (host == 'matrix.to') return false;
|
||||||
|
|
||||||
if (node.textContent.toLowerCase().trim().startsWith(host.toLowerCase())) {
|
if (node.textContent.toLowerCase().trim().startsWith(host.toLowerCase())) {
|
||||||
// it's a "foo.pl" style link
|
// it's a "foo.pl" style link
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue