Permalink
Browse files

Improve auto-linking of URLs in messages

Fixes #598.
  • Loading branch information...
gasi-signal committed Apr 10, 2018
1 parent 144cb58 commit ac50713f869e8a047bed2e34b3c97f53fba093a5
Showing with 4 additions and 2 deletions.
  1. +3 −2 js/views/message_view.js
  2. +1 −0 preload.js
@@ -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();
@@ -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 = {};

0 comments on commit ac50713

Please sign in to comment.