Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.01 KB

plain.md

File metadata and controls

35 lines (22 loc) · 1.01 KB

Plain

import { Plain } from 'slate'

A serializer that converts a Slate State to and from a plain text string.

Example

The Slate editor gives you full control over the logic you can add.\n
In its simplest form, when representing plain text, Slate is a glorified <textarea>. But you can augment it to be much more than that.\n
Check out http://slatejs.org for examples!

Methods

Plain.deserialize

Plain.deserialize(string: String) => State

Deserialize a plain text string into a State. A series of blocks will be created by splitting the input string on \n characters. Each block is given a type of 'line'.

Plain.serialize

Plain.serialize(state: State) => String

Serialize a state into a plain text string. Each direct child block of the document will be separated by a \n character.