Skip to content

Commit

Permalink
Apply CR remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Sep 20, 2024
1 parent 775b10e commit 4ee6dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ckeditor5-clipboard/src/clipboardpipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export default class ClipboardPipeline extends Plugin {
this.listenTo<ViewDocumentClipboardOutputEvent>( viewDocument, 'clipboardOutput', ( evt, data ) => {
if ( !data.content.isEmpty ) {
data.dataTransfer.setData( 'text/html', this.editor.data.htmlProcessor.toData( data.content ) );
data.dataTransfer.setData( 'text/plain', viewToPlainText( editor.editing.view.domConverter, data.content ) );
data.dataTransfer.setData( 'text/plain', viewToPlainText( editor.data.htmlProcessor.domConverter, data.content ) );
}

if ( data.method == 'cut' ) {
Expand Down
9 changes: 6 additions & 3 deletions packages/ckeditor5-clipboard/tests/utils/viewtoplaintext.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import viewToPlainText from '../../src/utils/viewtoplaintext.js';
import { parse as parseView } from '@ckeditor/ckeditor5-engine/src/dev-utils/view.js';

describe( 'viewToPlainText()', () => {
let converter;
let converter, viewDocument;

beforeEach( () => {
const viewDocument = new ViewDocument( new StylesProcessor() );

viewDocument = new ViewDocument( new StylesProcessor() );
converter = new DomConverter( viewDocument );
} );

afterEach( () => {
viewDocument.destroy();
} );

function testViewToPlainText( viewString, expectedText ) {
const view = parseView( viewString );
const text = viewToPlainText( converter, view );
Expand Down

0 comments on commit 4ee6dd1

Please sign in to comment.