Skip to content

Commit

Permalink
List Block: Remove heading transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 15, 2017
1 parent abddf98 commit 65a9424
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions blocks/library/list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ registerBlock( 'core/list', {
values: switchChildrenNodeName( content, 'li' )
} );
}
},
{
type: 'block',
blocks: [ 'core/heading' ],
transform: ( { content } ) => {
return createBlock( 'core/list', {
nodeName: 'ul',
values: [ <li key="1">{ content }</li> ]
} );
}
}
],
to: [
Expand All @@ -73,32 +63,6 @@ registerBlock( 'core/list', {
content: switchChildrenNodeName( values, 'p' )
} );
}
},
{
type: 'block',
blocks: [ 'core/heading' ],
transform: ( { values, ...attrs } ) => {
if ( Array.isArray( values ) ) {
const heading = createBlock( 'core/heading', {
content: values[ 0 ].props.children
} );
const blocks = [ heading ];

const remainingValues = values.slice( 1 );
if ( remainingValues.length ) {
const list = createBlock( 'core/list', {
...attrs,
values: remainingValues
} );
blocks.push( list );
}

return blocks;
}
return createBlock( 'core/heading', {
values
} );
}
}
]
},
Expand Down

0 comments on commit 65a9424

Please sign in to comment.