From ec01e5182d6b8c848d752540887a8113472b0226 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 6 Jul 2021 20:59:47 +0300 Subject: [PATCH] Fixed Line break which is wrongly added in Cards description and Cards comments. Added Code View `` button when RICHER_CARD_COMMENT_EDITOR=true and in desktop view (=non-mobile, so there is enough screen space for buttons in desktop view). Thanks to Emile840 and xet7 ! Fixes #3885 --- client/components/main/editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 8f2b27cd1..7437c2306 100644 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -50,7 +50,7 @@ Template.editor.onRendered(() => { ['table', ['table']], //['insert', ['link', 'picture', 'video']], // iframe tag will be sanitized TODO if iframe[class=note-video-clip] can be added into safe list, insert video can be enabled ['insert', ['link']], //, 'picture']], // modal popup has issue somehow :( - ['view', ['fullscreen', 'help']], + ['view', ['fullscreen', 'codeview', 'help']], ]; const cleanPastedHTML = function(input) { const badTags = [ @@ -229,7 +229,7 @@ Template.editor.onRendered(() => { // (and multiplies by pasting more) by changing paste "p" to "br". // Fixes https://github.com/wekan/wekan/2890 . // == Fix Start == - //someNote.execCommand('defaultParagraphSeparator', false, 'br'); + someNote.execCommand('defaultParagraphSeparator', false, 'br'); // == Fix End == const original = someNote.summernote('code'); const cleaned = cleanPastedHTML(original); //this is where to call whatever clean function you want. I have mine in a different file, called CleanPastedHTML.