Node - heading

Purpose

The heading node represents a heading.

Content

heading is a top-level block node.

Example

1
2
{
  "type": "heading",
  "attrs": {
    "level": 1
  },
  "content": [
    {
      "type": "text",
      "text": "Heading 1"
    }
  ]
}

Fields

NameRequiredTypeValue
typestring"heading"
contentarrayArray of zero or more inline nodes
attrsobject
attrs.levelinteger1-6
attrs.localIdstringAn ID to uniquely identify this node within the document.

Content

content takes any inline node.

Attributes

  • level represents the depth of the heading following the same convention as HTML: when level is set to 1 it's the equivalent of <h1>.

Rate this page: