Skip to content

ServerSideRender does not expose block's content #10478

@barryceelen

Description

@barryceelen

The block's HTML is passed along to the render function of a dynamic block. When using ServerSideRender the block's HTML is not made available to the render function, only it's attributes are passed along via the API request:

https://github.com/WordPress/gutenberg/blob/master/lib/class-wp-rest-block-renderer-controller.php#L149

One can access the block's HTML via the block's attributes (that would enable me to pass the html to the render function by adding it to the attributes), but that html content does not include nested blocks as they are within HTML comments:

content: {
	type: 'string',
	source: 'html',
},

I've tried accessing the block's "raw" unparsed HTML in my edit function but have not found a way to do so, is this exposed in any way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions