TheSunny
doc-ios
doc-ios
  • Introduction
  • Walkthroughs
    • Installing Slate
    • Adding Event Handlers
    • Defining Custom Block Nodes
    • Applying Custom Formatting
    • Using Plugins
    • Saving to a Database
    • Saving and Loading HTML Content
  • Guides
    • Changes
    • Data Model
    • Plugins
    • Rendering
    • Schemas
  • General
    • Plugins
    • Resources
    • Contributing
    • Changelog
    • FAQ
  • Slate Core
    • Block
    • Change
    • Character
    • Data
    • Document
    • Inline
    • Mark
    • Node
    • Operation
    • Range
    • Schema
    • Text
    • Value
    • setKeyGenerator
    • resetKeyGenerator
  • Slate React
    • Editor
    • Plugins
    • Custom Nodes
    • Core Plugins
    • cloneFragment
    • findDOMNode
    • findDOMRange
    • findNode
    • findRange
    • getEventRange
    • getEventTransfer
    • setEventTransfer
  • Other Packages
    • slate-html-serializer
    • slate-hyperscript
    • slate-plain-serializer
    • slate-prop-types
    • slate-schema-violations
    • slate-simulator
  • Contributing
    • iOS Development Guide
Powered by GitBook
On this page
  • Properties
  • characters
  • key
  • object
  • Computed Properties
  • text
  • Static Methods
  • Text.create
  • Text.fromJSON
  • Text.isText
  • Instance Methods
  • toJSON
  1. Slate Core

Text

PreviousSchemaNextValue

Last updated 7 years ago

import { Text } from 'slate'

A text node in a Slate . 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 with associated that make up the text node's content.

key

String

A unique identifier for the node.

object

String

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

Computed Properties

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.fromJSON

Text.fromJSON(object: Object) => Text

Create a text from a JSON object.

Text.isText

Text.isText(maybeText: Any) => Boolean

Returns a boolean if the passed in argument is a Text.

Instance Methods

toJSON

toJSON() => Object

Returns a JSON representation of the text.

Document
Characters
Marks
Inline
Block