From c1593bbf48fbc006a9c2f8efd12c914ff1b68e90 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 16 Apr 2015 14:01:00 +0200 Subject: [PATCH] Fixed handling of nested quotes --- .../files/js/3rdParty/redactor/plugins/wbbcode.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 25ae977797..f96eefdd87 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -2065,10 +2065,16 @@ RedactorPlugins.wbbcode = function() { var $quote = null; if (this.wutil.inWysiwygMode()) { - var $innerHTML = (plainText) ? this.wbbcode.convertToHtml(plainText) : html; var $id = WCF.getUUID(); - var $html = this.wbbcode.convertToHtml($openTag + $id + $closingTag); - $html = $html.replace($id, $innerHTML.replace(/^

/, '').replace(/<\/p>$/, '')); + var $html = ''; + if (plainText) { + $html = this.wbbcode.convertToHtml($openTag + plainText + $closingTag); + } + else { + $html = this.wbbcode.convertToHtml($openTag + $id + $closingTag); + $html = $html.replace($id, $innerHTML.replace(/^

/, '').replace(/<\/p>$/, '')); + } + $html = $html.replace(/^

/, '').replace(/<\/p>$/, ''); // assign a unique id in order to recognize the inserted quote -- 2.20.1