From 150e6c3c27dbf40fe261af3eb9af2a5bff8d6fb4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 2 Feb 2015 18:29:28 +0100 Subject: [PATCH] Fixed the famous br[type=_moz] bug. Again. --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 0f309e8cb8..3fefe1a1d0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -1735,7 +1735,12 @@ RedactorPlugins.wbbcode = function() { if ($quote !== null) { // set caret inside the quote if (!$html.length) { - this.caret.setStart($quote.find('> div')[0]); + // careful, Firefox is stupid and replaces an empty div with br[type=_moz] + if ($.browser.mozilla) { + $quote.children('br[type=_moz]').replaceWith('
' + this.opts.invisibleSpace + '
'); + } + + this.caret.setStart($quote.children('div')[0]); } } -- 2.20.1