diff --git a/js/views/message_view.js b/js/views/message_view.js
index 2740ed84c7fe..d0a5f9ea0c74 100644
--- a/js/views/message_view.js
+++ b/js/views/message_view.js
@@ -19,6 +19,8 @@
window.Whisper = window.Whisper || {};
+ const URL_REGEX = /(^|[\s\n]|
)((?:https?|ftp):\/\/[-A-Z0-9\u00A0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;
+
const ErrorIconView = Whisper.View.extend({
templateName: 'error-icon',
className: 'error-icon-container',
@@ -593,7 +595,11 @@
if (body.length > 0) {
const escapedBody = body.html();
- body.html(Signal.HTML.render(escapedBody));
+ body.html(
+ escapedBody
+ .replace(/\n/g, '
')
+ .replace(URL_REGEX, "$1$2")
+ );
}
this.renderSent();