From fd4e9c70920bde5bc5ace0f2fc7991a6213f3e41 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 2 Feb 2019 01:07:06 +0100 Subject: [PATCH] Experimental support for lists inside quotes/spoilers --- .../js/3rdParty/redactor2/plugins/WoltLabList.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js index 2847d5a733..bc4982be39 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js @@ -2,6 +2,8 @@ $.Redactor.prototype.WoltLabList = function() { "use strict"; return { + parentsQualifiedForLists: ['woltlab-quote', 'woltlab-spoiler'], + init: function () { this.list.combineAfterAndBefore = (function(block) { var $prev = $(block).prev(); @@ -99,6 +101,20 @@ $.Redactor.prototype.WoltLabList = function() { return nodes; }).bind(this); + + this.list._getBlocks = (function() { + return this.selection.blocks().filter((function(block) { + var parent = block.parentNode; + if (parent.classList.contains('redactor-in')) { + return true; + } + else if (this.WoltLabList.parentsQualifiedForLists.indexOf(parent.nodeName.toLowerCase()) !== -1) { + return true; + } + + return false; + }).bind(this)); + }).bind(this); } }; }; -- 2.20.1