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
This commit is contained in:
Lauri Ojansivu 2021-07-06 20:59:47 +03:00
parent 06d2880a7e
commit ec01e5182d

View file

@ -50,7 +50,7 @@ Template.editor.onRendered(() => {
['table', ['table']], ['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', '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 :( ['insert', ['link']], //, 'picture']], // modal popup has issue somehow :(
['view', ['fullscreen', 'help']], ['view', ['fullscreen', 'codeview', 'help']],
]; ];
const cleanPastedHTML = function(input) { const cleanPastedHTML = function(input) {
const badTags = [ const badTags = [
@ -229,7 +229,7 @@ Template.editor.onRendered(() => {
// (and multiplies by pasting more) by changing paste "p" to "br". // (and multiplies by pasting more) by changing paste "p" to "br".
// Fixes https://github.com/wekan/wekan/2890 . // Fixes https://github.com/wekan/wekan/2890 .
// == Fix Start == // == Fix Start ==
//someNote.execCommand('defaultParagraphSeparator', false, 'br'); someNote.execCommand('defaultParagraphSeparator', false, 'br');
// == Fix End == // == Fix End ==
const original = someNote.summernote('code'); 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. const cleaned = cleanPastedHTML(original); //this is where to call whatever clean function you want. I have mine in a different file, called CleanPastedHTML.