Fixed strange characters in plain text mode (Firefox) (Closes #462)

This commit is contained in:
RainLoop Team 2015-02-17 16:04:03 +04:00
parent 2a90664574
commit e3064b10aa
24 changed files with 206 additions and 159 deletions

View file

@ -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, '&amp;')
.replace(/>/g, '&gt;').replace(/</g, '&lt;')
@ -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;
}());