Bug 1267469 - New message invoked from news: URL starts in "Body Text" mode, replies allow undoing <p> insertion. r=jorgk a=jorgk CLOSED TREE
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -275,16 +275,17 @@ var stateListener = {
updateSendCommands(true);
},
NotifyComposeBodyReady: function() {
// Look all the possible compose types (nsIMsgComposeParams.idl):
switch (gComposeType) {
case Components.interfaces.nsIMsgCompType.New:
+ case Components.interfaces.nsIMsgCompType.NewsPost:
case Components.interfaces.nsIMsgCompType.ForwardAsAttachment:
this.NotifyComposeBodyReadyNew();
break;
case Components.interfaces.nsIMsgCompType.Reply:
case Components.interfaces.nsIMsgCompType.ReplyAll:
case Components.interfaces.nsIMsgCompType.ReplyToSender:
case Components.interfaces.nsIMsgCompType.ReplyToGroup:
@@ -354,16 +355,18 @@ var stateListener = {
return;
}
if (range.startContainer != mailBody) {
dump("Unexpected selection in NotifyComposeBodyReadyReply\n");
return;
}
+ editor.enableUndo(false);
+
// Delete a <br> if we see one.
let currentNode = mailBody.childNodes[start];
if (currentNode.nodeName == "BR") {
mailBody.removeChild(currentNode);
}
let pElement = editor.createElementWithDefaults("p");
let brElement = editor.createElementWithDefaults("br");