diff --git a/blocks/api/factory.js b/blocks/api/factory.js index 121b155e122fd..21d8c7791657b 100644 --- a/blocks/api/factory.js +++ b/blocks/api/factory.js @@ -67,8 +67,8 @@ export function createBlock( name, blockAttributes = {} ) { export function switchToBlockType( blocks, name ) { const blocksArray = castArray( blocks ); const isMultiBlock = blocksArray.length > 1; - const fistBlock = blocksArray[ 0 ]; - const sourceName = fistBlock.name; + const firstBlock = blocksArray[ 0 ]; + const sourceName = firstBlock.name; if ( isMultiBlock && ! every( blocksArray, ( block ) => ( block.name === sourceName ) ) ) { return null; @@ -99,7 +99,7 @@ export function switchToBlockType( blocks, name ) { if ( transformation.isMultiBlock ) { transformationResults = transformation.transform( blocksArray.map( ( currentBlock ) => currentBlock.attributes ) ); } else { - transformationResults = transformation.transform( fistBlock.attributes ); + transformationResults = transformation.transform( firstBlock.attributes ); } // Ensure that the transformation function returned an object or an array @@ -130,7 +130,7 @@ export function switchToBlockType( blocks, name ) { ...result, // The first transformed block whose type matches the "destination" // type gets to keep the existing UID of the first block. - uid: index === firstSwitchedBlock ? fistBlock.uid : result.uid, + uid: index === firstSwitchedBlock ? firstBlock.uid : result.uid, } ) ); } diff --git a/blocks/editable/index.js b/blocks/editable/index.js index b2818952f7001..10de33f38900e 100644 --- a/blocks/editable/index.js +++ b/blocks/editable/index.js @@ -558,6 +558,7 @@ export default class Editable extends Component { if ( event.shiftKey || ! this.props.onSplit ) { this.editor.execCommand( 'InsertLineBreak', false, event ); } else { + event.stopImmediatePropagation(); this.splitContent(); } } diff --git a/blocks/library/list/index.js b/blocks/library/list/index.js index 724a43cf6d29e..b136253422fe1 100644 --- a/blocks/library/list/index.js +++ b/blocks/library/list/index.js @@ -154,16 +154,19 @@ registerBlockType( 'core/list', { blocks: [ 'core/paragraph' ], transform: ( { values } ) => compact( values.map( ( value ) => get( value, 'props.children', null ) ) ) - .map( ( content ) => createBlock( 'core/paragraph', { content } ) ), + .map( ( content ) => createBlock( 'core/paragraph', { + content: [ content ], + } ) ), }, { type: 'block', blocks: [ 'core/quote' ], transform: ( { values } ) => { return createBlock( 'core/quote', { - value: ( values.length === 1 ? values : initial( values ) ) - .map( ( value ) => ( { children:
{ get( value, 'props.children' ) }
} ) ), - citation: ( values.length === 1 ? undefined : get( last( values ), 'props.children' ) ), + value: compact( ( values.length === 1 ? values : initial( values ) ) + .map( ( value ) => get( value, 'props.children', null ) ) ) + .map( ( children ) => ( { children:{ children }
} ) ), + citation: ( values.length === 1 ? undefined : [ get( last( values ), 'props.children' ) ] ), } ); }, },