Developer
Documentation
Resources
Get Support
Sign in
Developer
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Developer
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Oct 15, 2025

Node - codeBlock

Purpose

The codeBlock node is a container for lines of code.

Type

codeBlock is a top-level block node.

Example

1
2
{
  "type": "codeBlock",
  "attrs": {
    "language": "javascript"
  },
  "content": [
    {
      "type": "text",
      "text": "var foo = {};\nvar bar = [];"
    }
  ]
}

Fields

NameRequiredTypeValue
typestring"codeBlock"
contentarrayAn array of nodes
attrsobject
attrs.languagestringLanguage of the code lines

Content

content takes an array of one or more text nodes without marks.

Attributes

Rate this page: