Skip to content

Commit

Permalink
List v2: remove quote transfroms as removed by Quote v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 26, 2022
1 parent bdad97f commit 586004c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 57 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

0 comments on commit 586004c

Please sign in to comment.