Skip to content

Given the javascript/editor representation of a block, is there a way to get it's rendered html? #63581

Answered by talldan
jakeparis asked this question in Q&A
Discussion options

You must be logged in to vote

wp.blocks.serialize( blocks ) should do the job.

If you're running this programmatically (outside of the context of an editor), then I believe you'd also have to register the block types first (wp.blocks.registerBlockType directly or by loading the block-library).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jakeparis
Comment options

Answer selected by jakeparis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants