diff --git a/blocks/library/heading/index.js b/blocks/library/heading/index.js index ff673288bc65f..493697fd23bb5 100644 --- a/blocks/library/heading/index.js +++ b/blocks/library/heading/index.js @@ -62,8 +62,14 @@ registerBlockType( 'core/heading', { type: 'raw', source: ( node ) => /H\d/.test( node.nodeName ), attributes: { - content: children( 'h1,h2,h3,h4,h5,h6' ), - nodeName: prop( 'h1,h2,h3,h4,h5,h6', 'nodeName' ), + content: { + type: 'array', + source: children( 'h1,h2,h3,h4,h5,h6' ), + }, + nodeName: { + type: 'string', + source: prop( 'h1,h2,h3,h4,h5,h6', 'nodeName' ), + }, }, }, { diff --git a/blocks/library/image/index.js b/blocks/library/image/index.js index c52e584e6cebb..26b6aaf1eeb48 100644 --- a/blocks/library/image/index.js +++ b/blocks/library/image/index.js @@ -79,9 +79,18 @@ registerBlockType( 'core/image', { ( ! node.textContent && node.querySelector( 'img' ) ) ), attributes: { - url: attr( 'img', 'src' ), - alt: attr( 'img', 'alt' ), - caption: children( 'figcaption' ), + url: { + type: 'string', + source: attr( 'img', 'src' ), + }, + alt: { + type: 'string', + source: attr( 'img', 'alt' ), + }, + caption: { + type: 'array', + source: children( 'figcaption' ), + }, }, }, ], diff --git a/blocks/library/list/index.js b/blocks/library/list/index.js index 8de0508ff6057..4977f4ef6dae9 100644 --- a/blocks/library/list/index.js +++ b/blocks/library/list/index.js @@ -124,8 +124,15 @@ registerBlockType( 'core/list', { type: 'raw', source: ( node ) => node.nodeName === 'OL' || node.nodeName === 'UL', attributes: { - nodeName: prop( 'ol,ul', 'nodeName' ), - values: children( 'ol,ul' ), + nodeName: { + type: 'string', + source: prop( 'ol,ul', 'nodeName' ), + }, + values: { + type: 'array', + source: children( 'ol,ul' ), + default: [], + }, }, }, { diff --git a/blocks/library/paragraph/index.js b/blocks/library/paragraph/index.js index 57dfa2b42e1bf..880cb72f64aed 100644 --- a/blocks/library/paragraph/index.js +++ b/blocks/library/paragraph/index.js @@ -56,7 +56,10 @@ registerBlockType( 'core/paragraph', { ! node.querySelector( 'audio, canvas, embed, iframe, img, math, object, svg, video' ) ), attributes: { - content: children( 'p' ), + content: { + type: 'array', + source: children( 'p' ), + }, }, }, ],