Was this article helpful?
Thanks for your feedback
In the JSON Rich Text Editor, each paragraph is a block; each block is an array; each array has multiple spans of text objects, storing different nodes of text. It returns clean data, making it easier to process in the backend.
The JSON RTE is composed of Blocks that contain text within them. The schema and example for a block within the RTE is as follows:
Schema:
{ uid: { type: String, required: true }, type: { type: String, required: true }, attrs: { type: Object }, children: { type: Array[id(Block), Text] } }
Example:
{ "type": "h1", "uid": "3ddd280397cf44bcb8f", "attrs": {}, "children": [ { "text": "Hello World!", "bold": true }, { "uid": "blta5aa9ca151e65333" }, { "text": "Welcome", "bold": true } ] }
Properties of Blocks within a JSON RTE:
Note: When you update an existing JSON RTE, you need to pass the dirty attribute for each content block. Set the attribute to true.
Additional Resource: You can read more about the schema of the JSON RTE in our documentation where we have covered it extensively.
Was this article helpful?
Thanks for your feedback