preserve multi-line formatting of team invite messages

master
ansuz 3 years ago
parent 0df76ed64e
commit 0e9a9ddfe0

@ -265,6 +265,7 @@
padding: 12px;
margin-bottom: 20px;
border-radius: @variables_radius;
overflow-wrap: break-word;
}
.cp-teams-invite-password {
margin-bottom: 20px;

@ -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) {

Loading…
Cancel
Save