Fixed the famous br[type=_moz] bug. Again.
authorAlexander Ebert <ebert@woltlab.com>
Mon, 2 Feb 2015 17:29:28 +0000 (18:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 2 Feb 2015 17:29:28 +0000 (18:29 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 0f309e8cb8f145c9962181d001553607faec9d25..3fefe1a1d05719227eae574e9ae728905585a53f 100644 (file)
@@ -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('<div>' + this.opts.invisibleSpace + '</div>');
+                                                       }
+                                                       
+                                                       this.caret.setStart($quote.children('div')[0]);
                                                }
                                        }