Fixed handling of newlines in <td> with lists
authorAlexander Ebert <ebert@woltlab.com>
Sat, 20 Jun 2015 14:28:21 +0000 (16:28 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 20 Jun 2015 14:28:21 +0000 (16:28 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index 7a8239c53f684465f9ebe5422ce98e0f59667ab5..2741e23ed0533e6070005544f8c71e8beefb2db6 100644 (file)
@@ -1226,7 +1226,9 @@ RedactorPlugins.wbbcode = function() {
                        
                        // fix newlines in tables represented with <p>...</p> instead of <br>
                        data = data.replace(/<td>([\s\S]+?)<\/td>/g, function(match, content) {
-                               return '<td>' + content.replace(/<p>/g, '').replace(/<\/p>/g, '<br>').replace(/<br>$/, '') + '</td>';
+                               content = content.replace(/<br(?: \/)?>(<[uo]l)/g, '$1');
+                               
+                               return '<td>' + content.replace(/<p><br(?: \/)?><\/p>/g, '<br>').replace(/<p>/g, '').replace(/<\/p>/g, '<br>').replace(/<br>$/, '') + '</td>';
                        });
                        
                        // insert list items