From 0f7e64242637fa5f60f4f63da57f17ddbefe1b50 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 24 Aug 2023 14:34:56 +0200 Subject: [PATCH 1/2] IBX-6313: Fixed anchor in empty paragraph --- src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 51855fd2..186b2e83 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -46,7 +46,7 @@ const VIEWPORT_TOP_OFFSET = 102; } getData() { - return this.editor.getData(); + return this.editor.getData({ trim: 'none' }); } getHTMLDocumentFragment(data) { From 7f43f16858b1cbdc80855af9a75857d924f17a06 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Tue, 29 Aug 2023 13:46:33 +0200 Subject: [PATCH 2/2] fix empty state --- .../Resources/public/js/CKEditor/core/base-ckeditor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 186b2e83..0a84d96d 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -46,7 +46,10 @@ const VIEWPORT_TOP_OFFSET = 102; } getData() { - return this.editor.getData({ trim: 'none' }); + const notTrimmedData = this.editor.getData({ trim: 'none' }); + const isDataEmpty = notTrimmedData === '

 

'; + + return isDataEmpty ? this.editor.getData() : notTrimmedData; } getHTMLDocumentFragment(data) {