Bug 1658839 - Follow up to preserve indentStr for later use, and undo one change. r=mkmelin DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D87243

--HG--
extra : rebase_source : 85c041ab445682802b9c9fb6b91c5f9231e1469d
extra : amend_source : a80da4be0ec9ab43dd2110b3d9530439f2362403
This commit is contained in:
Kai Engert 2020-08-17 12:17:58 +02:00
Родитель 5c91933f58
Коммит 009ddecb96
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -2909,8 +2909,11 @@ Enigmail.msg = {
pgpBlock = pgpBlock.replace(/^>>/gm, "> >");
}
// Escape regex chars.
let escapedIndent1 = indentStr.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
// Delete indentation
indentRegexp = new RegExp("^> ", "gm");
indentRegexp = new RegExp("^" + escapedIndent1, "gm");
pgpBlock = pgpBlock.replace(indentRegexp, "");
//tail = tail.replace(indentRegexp, "");
@ -2918,8 +2921,8 @@ Enigmail.msg = {
if (indentStr.match(/[ \t]*$/)) {
indentStr = indentStr.replace(/[ \t]*$/gm, "");
// Escape regex chars.
indentStr = indentStr.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
indentRegexp = new RegExp("^" + indentStr + "$", "gm");
let escapedIndent2 = indentStr.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
indentRegexp = new RegExp("^" + escapedIndent2 + "$", "gm");
pgpBlock = pgpBlock.replace(indentRegexp, "");
}