mirror of
https://github.com/moparisthebest/mail
synced 2025-02-28 08:41:49 -05:00
fix editot parsing
This commit is contained in:
parent
f25e7022d5
commit
65e276fc97
@ -18,8 +18,24 @@ define(function(require) {
|
|||||||
iv = util.random(128);
|
iv = util.random(128);
|
||||||
|
|
||||||
$scope.updatePreview = function() {
|
$scope.updatePreview = function() {
|
||||||
|
// remove generated html from body
|
||||||
|
var body = $scope.body;
|
||||||
|
|
||||||
|
function has(substr) {
|
||||||
|
return (body.indexOf(substr) !== -1);
|
||||||
|
}
|
||||||
|
while (has('<div>')) {
|
||||||
|
body = body.replace('<div>', '\n');
|
||||||
|
}
|
||||||
|
while (has('<br>')) {
|
||||||
|
body = body.replace('<br>', '\n');
|
||||||
|
}
|
||||||
|
while (has('</div>')) {
|
||||||
|
body = body.replace('</div>', '');
|
||||||
|
}
|
||||||
// Although this does encrypt live using AES, this is just for show. The plaintext is encrypted seperately using before sending the email.
|
// Although this does encrypt live using AES, this is just for show. The plaintext is encrypted seperately using before sending the email.
|
||||||
$scope.ciphertextPreview = aes.encrypt($scope.subject + $scope.body, key, iv);
|
var plaintext = ($scope.subject) ? $scope.subject + body : body;
|
||||||
|
$scope.ciphertextPreview = aes.encrypt(plaintext, key, iv);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user