Created
August 31, 2011 12:56
-
-
Save shirosaki/1183468 to your computer and use it in GitHub Desktop.
fix inline PGP quoted text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- origin/modules/plugins/enigmail.js 2011-08-29 09:48:13.000000000 +0900 | |
+++ [email protected]/modules/plugins/enigmail.js 2011-08-31 21:37:11.000000000 +0900 | |
@@ -179,6 +179,7 @@ | |
"<div class='moz-text-plain' wrap='true' graphical-quote='true'>" | |
+ EnigmailFuncs.formatPlaintextMsg(msgRfc822Text) | |
+ "</div>"; | |
+ replaceTextNodeToPre(bodyElement); | |
} | |
return statusFlagsObj.value; | |
} | |
@@ -189,6 +190,27 @@ | |
} | |
} | |
+// Fix incorrect quoted text | |
+function replaceTextNodeToPre(bodyElement) { | |
+ let pgpPartMark = false; | |
+ for each (let [, x] in Iterator(bodyElement.childNodes[0].childNodes)) { | |
+ if (x.nodeType == x.TEXT_NODE) { | |
+ let pre = x.ownerDocument.createElement("pre"); | |
+ pre.setAttribute("wrap", ""); | |
+ if (pgpPartMark) { | |
+ pre.style.display = "inline"; | |
+ pgpPartMark = false; | |
+ } | |
+ if (x.nextSibling && x.nextSibling.classList.contains("moz-txt-star")) { | |
+ pre.style.display = "inline"; | |
+ pgpPartMark = true; | |
+ } | |
+ pre.textContent = x.textContent; | |
+ x.parentNode.replaceChild(pre, x); | |
+ } | |
+ } | |
+} | |
+ | |
let enigmailHook = { | |
_domNode: null, | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment