preserve multi-line formatting of team invite messages

This commit is contained in:
ansuz 2022-05-31 19:30:32 +05:30
parent 0df76ed64e
commit 0e9a9ddfe0
2 changed files with 10 additions and 2 deletions

View File

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

View File

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