1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 01:02:31 +01:00

49 lines
832 B
Markdown
Raw Normal View History

2016-07-12 17:54:11 -07:00
# `Mark`
```js
import { Mark } from 'slate'
```
A formatting mark that can be associated with [`Characters`](./character.md). Marks are how Slate represents rich formatting like **bold** or _italic_.
- [Properties](#properties)
- [`data`](#data)
- [`type`](#type)
- [Static Methods](#static-methods)
- [`Mark.create`](#markcreate)
- [`Mark.createSet`](#markcreateset)
2016-07-12 17:54:11 -07:00
## Properties
```js
Mark({
data: Data,
type: String
})
```
### `data`
`Data`
A map of [`Data`](./data.md).
### `type`
`String`
The custom type of the mark (eg. `bold` or `italic`).
## Static Methods
### `Mark.create`
`Mark.create(properties: Object) => Mark`
Create a mark from a plain Javascript object of `properties`.
### `Mark.createSet`
`Mark.createSet(array: Array) => Set`
Create a set of marks from a plain Javascript `array`.