Fixed align BBCode
authorAlexander Ebert <ebert@woltlab.com>
Sun, 27 Jul 2014 15:24:10 +0000 (17:24 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 27 Jul 2014 15:24:10 +0000 (17:24 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index ce62f6d1d1a3d50a430d11e39fb1445bab2686d8..7b922ffcca2259afdfcbf667c481b7f9cdee974a 100644 (file)
@@ -319,7 +319,9 @@ RedactorPlugins.wbbcode = {
                html = $result;
                
                // [align]
-               html = html.replace(/<div style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)<\/div>/gi, "[align=$1]$2[/align]");
+               html = html.replace(/<(div|p) style="text-align: ?(left|center|right|justify);? ?">([\s\S]*?)\n/gi, function(match, tag, alignment, content) {
+                       return '[align=' + alignment + ']' + $.trim(content) + '[/align]';
+               });
                
                // [*]
                html = html.replace(/<li>/gi, '[*]');