mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Fixed strange characters in plain text mode (Firefox) (Closes #462)
This commit is contained in:
parent
2a90664574
commit
e3064b10aa
24 changed files with 206 additions and 159 deletions
|
|
@ -101,7 +101,7 @@
|
|||
*/
|
||||
HtmlEditor.prototype.clearSignatureSigns = function (sText)
|
||||
{
|
||||
return sText.replace(/(\u0002|\u0003|\u0004|\u0005)/g, '');
|
||||
return sText.replace(/(\u0002|\u0003|\u200C|\u200D)/g, '');
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -351,7 +351,6 @@
|
|||
key('up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space', sKeyScope, function (event, handler) {
|
||||
if (event && handler && handler.shortcut)
|
||||
{
|
||||
// TODO
|
||||
var iKey = 0;
|
||||
switch (handler.shortcut)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1009,6 +1009,10 @@
|
|||
;
|
||||
|
||||
sText = sHtml
|
||||
// specials for signature
|
||||
.replace(/\u0002\u0002/g, '\u200C\u200C')
|
||||
.replace(/\u0003\u0003/g, '\u200D\u200D')
|
||||
|
||||
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
|
||||
.replace(/[\s]+/gm, ' ')
|
||||
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
|
||||
|
|
@ -1154,6 +1158,11 @@
|
|||
sPlain = aText.join("\n");
|
||||
|
||||
sPlain = sPlain
|
||||
|
||||
// specials for signature
|
||||
.replace(/\u200C\u200C/g, '\u0002\u0002')
|
||||
.replace(/\u200D\u200D/g, '\u0003\u0003')
|
||||
|
||||
// .replace(/~~~\/blockquote~~~\n~~~blockquote~~~/g, '\n')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/>/g, '>').replace(/</g, '<')
|
||||
|
|
@ -1693,6 +1702,20 @@
|
|||
}
|
||||
};
|
||||
|
||||
Utils.substr = window.String.substr;
|
||||
if ('ab'.substr(-1) !== 'b')
|
||||
{
|
||||
Utils.substr = function(sStr, iStart, iLength)
|
||||
{
|
||||
if (iStart < 0)
|
||||
{
|
||||
iStart = sStr.length + iStart;
|
||||
}
|
||||
|
||||
return sStr.substr(iStart, iLength);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = Utils;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue