From cf202b2320d78d3bfeca61c051d4627c17fa21a1 Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Wed, 2 Sep 2020 14:24:20 +0300 Subject: [PATCH] Fixes #33: * No longer using `editor.setParagraphFormat()` - have switched to `document.execCommand("defaultparagraphseparator", etc etc)`. --- src/chrome/content/bidimailui-composer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chrome/content/bidimailui-composer.js b/src/chrome/content/bidimailui-composer.js index 38fe9608..c35146ff 100644 --- a/src/chrome/content/bidimailui-composer.js +++ b/src/chrome/content/bidimailui-composer.js @@ -489,7 +489,7 @@ BiDiMailUI.Composition = { dump('setParagraphMode failed to acquire editor object.'); return; } - editor.setParagraphFormat(modeStr); + editor.document.execCommand("defaultparagraphseparator", true, modeStr); // as we don't use doStatefulCommand, we need to update the command // state attribute... document.getElementById("cmd_paragraphState").setAttribute("state", modeStr); @@ -1375,7 +1375,8 @@ BiDiMailUI.Composition = { catch(ex) { } // -- "Remember old style" - editor.setParagraphFormat("p"); + editor.document.execCommand("defaultparagraphseparator", true, "p"); + var par = BiDiMailUI.Composition.findClosestBlockElement(editor.selection.focusNode); var prevPar = par.previousSibling;