From 2011c24f57274f7eabce95547570b995aa887e57 Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 29 May 2020 16:53:08 +0100 Subject: [PATCH] editor: Don't restrict plugins from being able to bring in newline content #2412 broke this, it was discovered in https://github.com/JohnMcLear/ep_copy_paste_images/issues/20. The limitation means that images can't be pasted within lists which IMHO is fine. I could refine this down to OL only but I think images within lists would be fine not to include. --- src/static/js/contentcollector.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 446113a13..d40236009 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -665,8 +665,12 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas { if (lines.length() - 1 == startLine) { - // commented out to solve #2412 - https://github.com/ether/etherpad-lite/issues/2412 - // cc.startNewLine(state); + // to solve #2412 - https://github.com/ether/etherpad-lite/issues/2412 + // added additional check to resolve https://github.com/JohnMcLear/ep_copy_paste_images/issues/20 + // this does mean that images etc can't be pasted on lists but imho that's fine + if(state.lineAttributes && !state.lineAttributes.list){ + cc.startNewLine(state); + } } else {