Skip to content

Commit

Permalink
List v2: remove Quote transforms as removed by Quote v2 (WordPress#42700
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ellatrix authored Jul 26, 2022
1 parent bb9d9ce commit f2b3b17
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 59 deletions.
17 changes: 0 additions & 17 deletions packages/block-library/src/list/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,6 @@ const transforms = {
} )
),
},
{
type: 'block',
blocks: [ 'core/pullquote' ],
transform: ( { values, anchor } ) => {
return createBlock( 'core/pullquote', {
value: toHTMLString( {
value: create( {
html: values,
multilineTag: 'li',
multilineWrapperTags: [ 'ul', 'ol' ],
} ),
multilineTag: 'p',
} ),
anchor,
} );
},
},
{
type: 'block',
blocks: [ 'core/table-of-contents' ],
Expand Down
42 changes: 2 additions & 40 deletions packages/block-library/src/list/v2/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ import { flatMap } from 'lodash';
/**
* WordPress dependencies
*/
import { createBlock, switchToBlockType } from '@wordpress/blocks';
import {
__UNSTABLE_LINE_SEPARATOR,
create,
split,
toHTMLString,
} from '@wordpress/rich-text';
import { createBlock } from '@wordpress/blocks';
import { create, split, toHTMLString } from '@wordpress/rich-text';

/**
* Internal dependencies
Expand Down Expand Up @@ -83,26 +78,6 @@ const transforms = {
);
},
},
{
type: 'block',
blocks: [ 'core/quote', 'core/pullquote' ],
transform: ( { value, anchor } ) => {
return createBlock(
'core/list',
{
anchor,
},
split(
create( { html: value, multilineTag: 'p' } ),
__UNSTABLE_LINE_SEPARATOR
).map( ( result ) => {
return createBlock( 'core/list-item', {
content: toHTMLString( { value: result } ),
} );
} )
);
},
},
...[ '*', '-' ].map( ( prefix ) => ( {
type: 'prefix',
prefix,
Expand Down Expand Up @@ -147,19 +122,6 @@ const transforms = {
);
},
} ) ),
...[ 'core/quote', 'core/pullquote' ].map( ( block ) => ( {
type: 'block',
blocks: [ block ],
transform: ( attributes, innerBlocks ) => {
return switchToBlockType(
switchToBlockType(
createBlock( 'core/list', attributes, innerBlocks ),
'core/paragraph'
),
block
);
},
} ) ),
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe( 'Block Switcher', () => {
'Group',
'Paragraph',
'Heading',
'Pullquote',
'Quote',
'Columns',
'Table of Contents',
] )
Expand All @@ -55,7 +55,6 @@ describe( 'Block Switcher', () => {
expect.arrayContaining( [
'Group',
'Paragraph',
'Pullquote',
'Heading',
'Table of Contents',
] )
Expand Down

0 comments on commit f2b3b17

Please sign in to comment.