diff --git a/source/Clipboard.ts b/source/Clipboard.ts index be361f0..bba6b55 100644 --- a/source/Clipboard.ts +++ b/source/Clipboard.ts @@ -163,7 +163,7 @@ const _onCut = function (this: Squire, event: ClipboardEvent): void { root, true, this._config.willCutCopy, - null, + this._config.toPlainText, false, ); if (!handled) { @@ -187,7 +187,7 @@ const _onCopy = function (this: Squire, event: ClipboardEvent): void { this._root, false, this._config.willCutCopy, - null, + this._config.toPlainText, false, ); }; diff --git a/source/Editor.ts b/source/Editor.ts index c66eccd..2bd8b27 100644 --- a/source/Editor.ts +++ b/source/Editor.ts @@ -87,6 +87,7 @@ interface SquireConfig { }; addLinks: boolean; willCutCopy: null | ((html: string) => string); + toPlainText: null | ((html: string) => string); sanitizeToDOMFragment: (html: string, editor: Squire) => DocumentFragment; didError: (x: any) => void; } @@ -221,6 +222,7 @@ class Squire { }, addLinks: true, willCutCopy: null, + toPlainText: null, sanitizeToDOMFragment: ( html: string, /* editor: Squire, */