From: Alexander Ebert Date: Fri, 12 Dec 2014 23:09:17 +0000 (+0100) Subject: Fixed a few issues related to multi-line list items X-Git-Tag: 2.1.0_Beta_1~51 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=66f8f81493c71eb283bdda0924020a9c95c2f4ef;p=GitHub%2FWoltLab%2FWCF.git Fixed a few issues related to multi-line list items --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 69f92204c6..1022034ec0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -80,6 +80,14 @@ RedactorPlugins.wbbcode = function() { // fix button label for source toggling var $tooltip = $('.redactor-toolbar-tooltip-html:not(.jsWbbcode)').addClass('jsWbbcode').text(WCF.Language.get('wcf.bbcode.button.toggleBBCode')); + var $fixBR = function(editor) { + editor.find('br').each(function(index, br) { + if (br.children.length) { + $(br).empty(); + } + }); + }; + this.code.toggle = (function() { if (this.opts.visual) { this.code.startSync(); @@ -100,6 +108,7 @@ RedactorPlugins.wbbcode = function() { this.button.get('html').children('i').removeClass('fa-square').addClass('fa-square-o'); $tooltip.text(WCF.Language.get('wcf.bbcode.button.toggleBBCode')); + $fixBR(this.$editor); this.wutil.saveSelection(); } @@ -695,7 +704,7 @@ RedactorPlugins.wbbcode = function() { data = data.replace(/\[align=(left|right|center|justify)\]([\s\S]*?)\[\/align\]/gi,'
$2
'); // [*] - data = data.replace(/\[\*\](.*?)(?=\[\*\]|\[\/list\])/gi,'
  • $1
  • '); + data = data.replace(/\[\*\]([\s\S]*?)(?=\[\*\]|\[\/list\])/gi,'
  • $1
  • '); // [list] data = data.replace(/\[list\]/gi, '