diff --git a/blocks/api/parser.js b/blocks/api/parser.js index 006f942c1fb01a..a165b22bdb9fb1 100644 --- a/blocks/api/parser.js +++ b/blocks/api/parser.js @@ -52,8 +52,8 @@ export function getBlockAttributes( blockType, rawContent, attributes ) { attributes = attributes || {}; if ( blockType ) { attributes = { - ...attributes, ...blockType.defaultAttributes, + ...attributes, ...parseBlockAttributes( rawContent, blockType ), }; } diff --git a/blocks/api/test/parser.js b/blocks/api/test/parser.js index d5759318ccb262..c83caf605006b2 100644 --- a/blocks/api/test/parser.js +++ b/blocks/api/test/parser.js @@ -76,6 +76,7 @@ describe( 'block parser', () => { }; }, defaultAttributes: { + content: '', topic: 'none', }, }; diff --git a/blocks/test/fixtures/core-latestposts.json b/blocks/test/fixtures/core-latestposts.json index 619edde2c7b2c0..515a6af9aee5ae 100644 --- a/blocks/test/fixtures/core-latestposts.json +++ b/blocks/test/fixtures/core-latestposts.json @@ -3,7 +3,7 @@ "uid": "_uid_0", "name": "core/latestposts", "attributes": { - "poststoshow": 5 + "poststoshow": "5" } } ]