WordPress.org

Home / Handbook / Contributors Guide / The Gutenberg block grammar

The Gutenberg block grammar Edit

Block_List
= $(!Block .)* (Block $(!Block .)*)* $(.*)
Block
= Block_Void / Block_Balanced
Block_Void
= "<!--" __ "wp:" Block_Name __ (Block_Attributes __)? "/-->"
Block_Balanced
= Block_Start (Block / $(!Block_End .))* Block_End
Block_Start
= "<!--" __ "wp:" Block_Name __ (Block_Attributes __)? "-->"
Block_End
= "<!--" __ "/wp:" Block_Name __ "-->"
Block_Name
= Namespaced_Block_Name / Core_Block_Name
Namespaced_Block_Name
= $(Block_Name_Part "/" Block_Name_Part)
Core_Block_Name
= $(Block_Name_Part)
Block_Name_Part
= $([a-z] [a-z0-9_-]*)
JSON-encoded attributes embedded in a block’s opening comment
Block_Attributes
= $("{" (!("}" __ "" "/"? "-->") .)* "}")
__
= [ \t\r\n]+
Skip to toolbar