Fixed an issue with unclosed formatting in tables
authorAlexander Ebert <ebert@woltlab.com>
Sun, 26 Apr 2015 15:13:42 +0000 (17:13 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 26 Apr 2015 15:13:42 +0000 (17:13 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index f87fd2eea226730fc87453c7bcb7c3e2d10248d3..5c2aa24c505875d81926985d7a579ec2bf87312e 100644 (file)
@@ -1433,6 +1433,15 @@ RedactorPlugins.wbbcode = function() {
                                return openingTag + this.opts.invisibleSpace + closingTag;
                        }
                        
+                       // check for unclosed tags in tables
+                       var $index = content.indexOf('[/td]');
+                       if ($index !== -1) {
+                               var $tmp = content.substring(0, $index);
+                               if ($tmp.indexOf('[td]') === -1) {
+                                       return openingTag + $tmp + closingTag + content.substring($index);
+                               }
+                       }
+                       
                        var $tmp = content.split("\n");
                        content = '';