Node - heading

Purpose

The heading node represents a heading (e.g. <h1>) and contains only inline nodes.

Example

1
2
3
4
5
6
7
8
9
10
11
12
{
  "type": "heading",
  "attrs": {
    "level": 1
  },
  "content": [
    {
      "type": "text",
      "text": "Heading 1"
    }
  ]
}

Content

heading is a block node in the top-level blocks group that contains only inline nodes as children.

Fields

NameMandatoryTypeValueNotes
typestring"heading"
contentarrayArray of zero or more inline nodes
attrsobject
attrs.levelinteger1-6The heading level (following the same convention as HTML), e.g. 1 → <h1>>