Skip to content

Commit

Permalink
fix(mail(js)): improve quoted message when replying
Browse files Browse the repository at this point in the history
Fixes #5223
  • Loading branch information
cgx committed Mar 2, 2021
1 parent 6f90977 commit fa3e5e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions UI/WebServerResources/js/Mailer/Message.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,15 @@
if (accountDefaults.security.alwaysEncrypt)
data.encrypt = true;
}
if (data.isHTML) {
// Sanitize HTML replies to properly display quoted content in CKEditor
var html = angular.element('<div>' + data.text + '</div>');
html.find('meta').remove();
html.find('link').remove();
html.find('base').remove();
html.find('title').remove();
data.text = html.html();
}
angular.extend(message.editable, data);

// We keep a reference to our original message in order to update the flags
Expand Down

0 comments on commit fa3e5e0

Please sign in to comment.