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();