Skip to content

Commit

Permalink
Fix switching text blocks to headings
Browse files Browse the repository at this point in the history
  • Loading branch information
nylen authored and youknowriad committed Apr 19, 2017
1 parent 9127e24 commit ce8660c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blocks/library/heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ registerBlock( 'core/heading', {
type: 'block',
blocks: [ 'core/text' ],
transform: ( { content, align } ) => {
if ( Array.isArray( content ) ) {
// TODO this appears to always be true?
// TODO reject the switch if more than one paragraph
content = content[ 0 ];
}
return {
tag: 'H2',
content,
Expand Down

0 comments on commit ce8660c

Please sign in to comment.