Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List v2: remove quote transforms as removed by Quote v2 #42700

Merged
merged 2 commits into from Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 0 additions & 17 deletions packages/block-library/src/list/transforms.js
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
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
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