Fixed formatting causing newlines to be discarded
authorAlexander Ebert <ebert@woltlab.com>
Fri, 19 Sep 2014 10:21:17 +0000 (12:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 19 Sep 2014 10:21:17 +0000 (12:21 +0200)
Fixes #1796

wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 49fc415d2482f4971bd515d7b8656355c1f5b672..086e1d6f1467c8415ecaeca199f434cd549521ea 100644 (file)
@@ -650,10 +650,10 @@ RedactorPlugins.wbbcode = {
                for (var $i = 0, $length = $tmp.length; $i < $length; $i++) {
                        var $line = $.trim($tmp[$i]);
                        
-                       if ($line.indexOf('<') === 0) {
+                       if ($line.match(/^<([a-z]+)/)) {
                                data += $line;
                                
-                               if (!$line.match(/>$/) || $line.match(/<span[^>]+>.*?<\/span>$/)) {
+                               if (!this.opts.rBlockTest.test(RegExp.$1.toUpperCase())) {
                                        data += '<br>';
                                }
                        }