From 0e9a9ddfe011fea0de26ea04fc66ec76aa3dc2f4 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 31 May 2022 19:30:32 +0530 Subject: [PATCH] preserve multi-line formatting of team invite messages --- www/teams/app-team.less | 1 + www/teams/inner.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/www/teams/app-team.less b/www/teams/app-team.less index dab9d9de1..c63e56041 100644 --- a/www/teams/app-team.less +++ b/www/teams/app-team.less @@ -265,6 +265,7 @@ padding: 12px; margin-bottom: 20px; border-radius: @variables_radius; + overflow-wrap: break-word; } .cp-teams-invite-password { margin-bottom: 20px; diff --git a/www/teams/inner.js b/www/teams/inner.js index c498e4876..450ac6189 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -1349,8 +1349,15 @@ define([ Messages._getKey('team_inviteFromMsg', [Util.fixHTML(getDisplayName(json.author.displayName)), Util.fixHTML(json.teamName)]))); - if (json.message) { - $div.append(h('div.cp-teams-invite-message', json.message)); + if (typeof(json.message) === 'string') { + var message = h('div.cp-teams-invite-message'); + json.message.split('\n').forEach(line => { + if (line.trim()) { + message.appendChild(h('span', line)); + } + message.appendChild(h('br')); + }); + $div.append(message); } })); }).nThen(function (waitFor) {