Skip to main content

Ordered List

Below you can view an example of the ordered list block in JSON format.

{
"type": "ordered_list",
"attrs": {
"order": 1,
"blockId": "blockId"
},
"content": [
{
"type": "list_item",
"attrs": {
"blockId": "blockId"
},
"content": [
{
"type": "paragraph",
"attrs": {
"align": "left",
"blockId": "blockId",
"dropCap": false
},
"content": [
{
"type": "text",
"text": "This is a list item"
}
],
"contentHTML": "This is a list item"
}
],
"contentHTML": "<p>This is a list item</p>"
}
],
"contentHTML": "<li><p>This is a list item</p></li>"
}
info

Ordered list blocks will automatically nest themselves whenever there is a new list item added. If you were to add a new list item, a new content array of objects would be created inside the content array of the ordered list object. Any changes made to the text in itself (i.e. making it bold or italic) would make paragraph nesting rules also apply. See the paragraph documentation here.

Below you can read details about each attribute of the ordered list block.

type

A string that represents the type of the block. Ordered list blocks will always display ordered_list as their type. List items will display list_item as their type.

text

A string that represents the text written by the user.

marks

An array of objects that represents the marks of the block. This value can be something like bold or italic.

marks

An array of objects that represents the marks of the block. This value can be something like bold or italic.

content

An array of objects that represents the content of the block.

attrs

An object that represents the attributes of the block.

attrs.order

A number that represents the order of the ordered list item. This value increments from 1 automatically.

attrs.align

A string that represents the text alignment. This value can be left, center, or right.

attrs.blockId

A string that represents the unique block ID of the ordered list.

contentHTML

A string that represents the generated HTML of the block.