From: Alexander Ebert Date: Sat, 28 Feb 2015 18:20:04 +0000 (+0100) Subject: Improved handling of code boxes incorrectly wrapped in

X-Git-Tag: 2.1.0~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cea44a5cccb6c02e0f4e3b074561706fd0091ff2;p=GitHub%2FWoltLab%2FWCF.git Improved handling of code boxes incorrectly wrapped in

--- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 035d130cf3..42f51e7de7 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -319,6 +319,11 @@ RedactorPlugins.wbbcode = function() { html = html.replace(/

<\/p>

<\/p>/g, '

'); + // unwrap code boxes + for (var $uuid in $cachedCodeListings) { + html = html.replace(new RegExp('

<\/p>@@@' + $uuid + '@@@

<\/p>'), '@@@' + $uuid + '@@@'); + } + // handle empty paragraphs not followed by an empty one html = html.replace(/

<\/p>

(?!
)/g, '

@@@wcf_empty_line@@@

');