Skip to content

Commit

Permalink
Embrace entity data format instead of augmenting reusable blocks to l…
Browse files Browse the repository at this point in the history
…egacy data shape
  • Loading branch information
adamziel committed Oct 9, 2020
1 parent bc06f59 commit 8bf36e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ export const getInserterItems = createSelector(
id,
name: 'core/block',
initialAttributes: { ref: reusableBlock.id },
title: reusableBlock.title,
title: reusableBlock.title.raw,
icon: referencedBlockType
? referencedBlockType.icon
: templateIcon,
Expand Down Expand Up @@ -1688,7 +1688,7 @@ export const __experimentalGetParsedReusableBlock = createSelector(
return null;
}

return parse( reusableBlock.content );
return parse( reusableBlock.content.raw );
},
( state ) => [ getReusableBlocks( state ) ]
);
Expand Down
6 changes: 1 addition & 5 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,7 @@ class EditorProvider extends Component {
'titlePlaceholder',
] ),
mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
__experimentalReusableBlocks: reusableBlocks?.map( ( c ) => ( {
...c,
content: c.content.raw,
title: c.title.raw,
} ) ),
__experimentalReusableBlocks: reusableBlocks,
__experimentalFetchLinkSuggestions: partialRight(
fetchLinkSuggestions,
settings
Expand Down

0 comments on commit 8bf36e2

Please sign in to comment.