1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-23 16:55:23 +01:00
2016-11-09 10:26:33 +01:00

1.6 KiB

Text

import { Text } from 'slate'

A text node in a Slate Document. Text nodes are always the bottom-most leaves in the document, just like in the DOM.

Properties

Text({
  characters: Immutable.List<Character>,
  key: String
})

characters

A list of Characters with associated Marks that make up the text node's content.

key

String

A unique identifier for the node.

Computed Properties

kind

String

An immutable string value of 'text' for easily separating this node from Inline or Block nodes.

length

Number

The length of all of the characters in the text node.

text

String

A concatenated string of all of the characters in the text node.

Static Methods

Text.create

Text.create(properties: Object) => Text

Create a text from a plain Javascript object of properties.

Text.createFromRanges

Text.createFromRanges(ranges: List<Range>) => Text

Create a text from a list of text ranges.

Text.createFromString

Text.createFromString(text: String, marks: Set) => Text

Create a text from a plain String and a set of marks.