Skip to content

Commit

Permalink
Use tabs instead of spaces in block transform doc example (#33549)
Browse files Browse the repository at this point in the history
  • Loading branch information
jblz authored Jul 20, 2021
1 parent 596fc0e commit 8afca1e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/how-to-guides/widgets/legacy-widget-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ This is done by adding JavaScript code to your block's definition. In this examp

```js
transforms: {
from: [
{
type: 'block',
blocks: [ 'core/legacy-widget' ],
from: [
{
type: 'block',
blocks: [ 'core/legacy-widget' ],
isMatch: ( { idBase, instance } ) => {
if ( ! instance?.raw ) {
// Can't transform if raw instance is not shown in REST API.
return false;
}
return idBase === 'example_widget';
},
transform: ( { instance } ) => {
return createBlock( 'example/block', {
transform: ( { instance } ) => {
return createBlock( 'example/block', {
name: instance.raw.name,
} );
},
},
]
} );
},
},
]
},
```
Expand Down

0 comments on commit 8afca1e

Please sign in to comment.