From d31e7281f6002f9990f3978b471352e6a451e424 Mon Sep 17 00:00:00 2001 From: DawidKossowskii Date: Mon, 30 Dec 2024 16:18:31 +0100 Subject: [PATCH] Extend the _forceMarkersCopy method to enable ignoring markers. --- packages/ckeditor5-clipboard/src/clipboardmarkersutils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ckeditor5-clipboard/src/clipboardmarkersutils.ts b/packages/ckeditor5-clipboard/src/clipboardmarkersutils.ts index 4619a7d680d..38d0fd8225e 100644 --- a/packages/ckeditor5-clipboard/src/clipboardmarkersutils.ts +++ b/packages/ckeditor5-clipboard/src/clipboardmarkersutils.ts @@ -220,7 +220,7 @@ export default class ClipboardMarkersUtils extends Plugin { public _forceMarkersCopy( markerName: string, executor: VoidFunction, - config: ClipboardMarkerConfiguration = { + config: ClipboardMarkerConfiguration | null = { allowedActions: 'all', copyPartiallySelected: true, duplicateOnPaste: true @@ -228,7 +228,11 @@ export default class ClipboardMarkersUtils extends Plugin { ): void { const before = this._markersToCopy.get( markerName ); - this._markersToCopy.set( markerName, config ); + if ( config ) { + this._markersToCopy.set( markerName, config ); + } else { + this._markersToCopy.delete( markerName ); + } executor();