From cd89e20b90adadae86ae8dd1742d491ff68cf3ee Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 5 Jan 2017 13:27:04 +0100 Subject: [PATCH] Deny block elements inside lists --- .../files/js/3rdParty/redactor2/plugins/WoltLabBlock.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js index 3a240230bb..9a4e1feac4 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js @@ -31,6 +31,12 @@ $.Redactor.prototype.WoltLabBlock = function() { var mpFormatCollapsed = this.block.formatCollapsed; this.block.formatCollapsed = (function(tag, attr, value, type) { + var block = this.selection.block(); + if (block && block.nodeName === 'LI') { + // lists cannot contain other block elements + return; + } + if (this.detect.isFirefox()) { var editor = this.core.editor()[0]; if (document.activeElement !== editor) { -- 2.20.1