2016-07-12 17:54:11 -07:00
|
|
|
|
|
|
|
# `Character`
|
|
|
|
|
|
|
|
```js
|
|
|
|
import { Character } from 'slate'
|
|
|
|
```
|
|
|
|
|
|
|
|
A character in a [`Text`](./text.md) node.
|
|
|
|
|
|
|
|
Characters are how Slate associates [`Marks`](./mark.md) with a range of text, for formatting.
|
|
|
|
|
|
|
|
- [Properties](#properties)
|
|
|
|
- [`marks`](#marks)
|
|
|
|
- [`text`](#text)
|
|
|
|
- [Static Methods](#static-methods)
|
2016-07-18 02:30:31 +05:30
|
|
|
- [`Character.create`](#charactercreate)
|
|
|
|
- [`Character.createList`](#charactercreatelist)
|
2016-07-12 17:54:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
```js
|
|
|
|
Character({
|
|
|
|
marks: Immutable.Set<Mark>,
|
|
|
|
text: String
|
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
### `marks`
|
|
|
|
`Immutable.Set`
|
|
|
|
|
|
|
|
A set of [`Marks`](./mark.md) attached to the character.
|
|
|
|
|
|
|
|
### `text`
|
|
|
|
`String`
|
|
|
|
|
|
|
|
The text string of the character.
|
|
|
|
|
|
|
|
|
|
|
|
## Static Methods
|
|
|
|
|
|
|
|
### `Character.create`
|
|
|
|
`Character.create(properties: Object) => Character`
|
|
|
|
|
|
|
|
Create a character from a plain Javascript object of `properties`.
|
|
|
|
|
|
|
|
### `Character.createList`
|
|
|
|
`Character.createList(array: Array) => List`
|
|
|
|
|
|
|
|
Create a list of characters from a plain Javascript `array`.
|