Improve auto-linking of URLs in messages

Fixes #598.
This commit is contained in:
Daniel Gasienica 2018-04-10 13:03:50 -04:00
parent 144cb58a47
commit ac50713f86
2 changed files with 4 additions and 2 deletions

View file

@ -6,6 +6,7 @@
'use strict';
window.Whisper = window.Whisper || {};
const { HTML } = window.Signal;
const { Attachment } = window.Signal.Types;
const { loadAttachmentData } = window.Signal.Migrations;
@ -375,8 +376,8 @@
emoji_util.parse(body);
if (body.length > 0) {
var escaped = body.html();
body.html(escaped.replace(/\n/g, '<br>').replace(URL_REGEX, "$1<a href='$2' target='_blank'>$2</a>"));
const escapedBody = body.html();
body.html(HTML.render(escapedBody));
}
this.renderSent();

View file

@ -158,6 +158,7 @@ window.Signal.Backup = require('./js/modules/backup');
window.Signal.Crypto = require('./js/modules/crypto');
window.Signal.Database = require('./js/modules/database');
window.Signal.Debug = require('./js/modules/debug');
window.Signal.HTML = require('./ts/html');
window.Signal.Logs = require('./js/modules/logs');
window.Signal.Components = {};