Index
Edit

Span

A span is a text range witin a block that shares the same set of marks. It is a child of a block type's .children.

You don't have to define anything in your schema for the span type.

In the data, a span will have the properties .marks (array) and .text (text) as the below example shows. In the third span you see how it has a mark cbe9d12c6af9 (key) besides strong (decorator name) that points to the link annotation in this block's .markDefs array.

{
  "_key": "9d2d1ed68d84",
  "_type": "block",
  "children": [
    {
      "_type": "span",
      "marks": [],
      "text": "I am "
    },
    {
      "_type": "span",
      "marks": [
        "strong"
      ],
      "text": "strong and "
    },
    {
      "_type": "span",
      "marks": [
        "strong",
        "cbe9d12c6af9"
      ],
      "text": "annotated"
    },
    {
      "_type": "span",
      "marks": [],
      "text": ""
    }
  ],
  "markDefs": [
    {
      "_key": "cbe9d12c6af9",
      "_type": "link",
      "href": "https://www.google.com/?q=annotation"
    }
  ],
  "style": "normal"
}

Previous: Block TextNext: Datetime