From 1b105202f19dea5dbdb817798055d2e30b7854db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Thu, 21 Mar 2019 21:41:10 +0100 Subject: [PATCH] Paste: check plain text for gutenberg content (#14536) --- packages/blocks/src/api/raw-handling/paste-handler.js | 11 ++++++++--- test/integration/blocks-raw-handling.spec.js | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/blocks/src/api/raw-handling/paste-handler.js b/packages/blocks/src/api/raw-handling/paste-handler.js index b40164f549689b..1d67540c0b9225 100644 --- a/packages/blocks/src/api/raw-handling/paste-handler.js +++ b/packages/blocks/src/api/raw-handling/paste-handler.js @@ -127,9 +127,14 @@ export function pasteHandler( { HTML = '', plainText = '', mode = 'AUTO', tagNam // First of all, strip any meta tags. HTML = HTML.replace( /]+>/, '' ); - // If we detect block delimiters, parse entirely as blocks. - if ( mode !== 'INLINE' && HTML.indexOf( ''; + expect( serialize( pasteHandler( { + plainText: block, + mode: 'AUTO', + } ) ) ).toBe( block ); + } ); + describe( 'pasteHandler', () => { [ 'plain',