Bug 1354002 - set defaultparagraphseparator based on pref mail.compose.default_to_paragraph. r=aceman
☠☠ backed out by 831a455bfe2f ☠ ☠
authorJorg K <jorgk@jorgk.com>
Thu, 20 Apr 2017 08:16:08 +0200
changeset 21433 ae3cb512e8d286c2161d44a8ac15ffffa96b9c29
parent 21432 1ddef19a660bf15b818b51278973b988f04455a7
child 21434 55b04a77e7610a1907960a9268f5e816869cddc8
push id13047
push usermozilla@jorgk.com
push dateThu, 20 Apr 2017 06:22:24 +0000
treeherdercomm-central@55b04a77e761 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1354002
Bug 1354002 - set defaultparagraphseparator based on pref mail.compose.default_to_paragraph. r=aceman
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -5356,19 +5356,20 @@ function InitEditor()
   // inconsistent in subject and message body.
   let eEditorMailMask = Components.interfaces.nsIPlaintextEditor.eEditorMailMask;
   editor.flags |= eEditorMailMask;
   GetMsgSubjectElement().editor.flags |= eEditorMailMask;
 
   // Control insertion of line breaks.
   editor.returnInParagraphCreatesNewParagraph =
     Services.prefs.getBoolPref("editor.CR_creates_new_p");
-  // Traditionally we want <br> elements for newlines, unless we're
-  // splitting a paragraph (which is not affected by this setting).
-  editor.document.execCommand("defaultparagraphseparator", false, "br");
+  editor.document.execCommand("defaultparagraphseparator", false,
+    gMsgCompose.composeHTML &&
+    Services.prefs.getBoolPref("mail.compose.default_to_paragraph") ?
+                               "p" : "br");
 
   editor.QueryInterface(nsIEditorStyleSheets);
   // We use addOverrideStyleSheet rather than addStyleSheet so that we get
   // a synchronous load, rather than having a late-finishing async load
   // mark our editor as modified when the user hasn't typed anything yet,
   // but that means the sheet must not @import slow things, especially
   // not over the network.
   editor.addOverrideStyleSheet("chrome://messenger/content/composerOverlay.css");