Node - hardBreak

Purpose

The hardBreak node is an inline node that represents a new line in a text string.

It's essentially the equivalent to a <br/> in HTML.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "version": 1,
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        {
          "type": "text",
          "text": "Hello"
        },
        {
          "type": "hardBreak"
        },
        {
          "type": "text",
          "text": "world"
        },
      ]
    }
  ]
}

Content

hardBreak is an immutable node in the inlines group that can not be modified.

Fields

NameMandatoryTypeValueNotes
attrsobject
attrs.textstring"\n"
typestring"hardBreak"