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
  • object
  • marks
  • text
  • Static Methods
  • Character.create
  • Character.createList
  • Character.fromJSON
  • Character.isCharacter
  • Instance Methods
  • toJSON
  1. Slate Core

Character

PreviousChangeNextData

Last updated 7 years ago

import { Character } from 'slate'

A character in a node.

Characters are how Slate associates with a range of text, for formatting.

Properties

Character({
  marks: Immutable.Set<Mark>,
  text: String
})

object

String

A string with a value of 'character'.

marks

Immutable.Set

A set of 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.

Character.fromJSON

Character.fromJSON(object: Object) => Character

Create a character from a JSON object.

Character.isCharacter

Character.isCharacter(maybeCharacter: Any) => Boolean

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

Instance Methods

toJSON

toJSON() => Object

Returns a JSON representation of the character.

Text
Marks
Marks