Index
Edit

Span

A span is a text range within a block have the same set of marks. It is a child of a block type's .children.

Properties

typestring

Required. Value must be set to span.

titlestring

Human readable label for the field.

namestring

Required. The field name. This will be the key in the data record.

hiddenboolean

If set to true, this field will be hidden in the Content Studio.

readOnlyboolean

If set to true, this field will not be editable in the content studio.

descriptionstring

Short description to editors how the field is to be used.

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: BlockNext: Datetime