From cea44a5cccb6c02e0f4e3b074561706fd0091ff2 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 28 Feb 2015 19:20:04 +0100 Subject: [PATCH] Improved handling of code boxes incorrectly wrapped in

--- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 5 +++++ 1 file changed, 5 insertions(+) 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@@@

'); -- 2.20.1