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
  • data
  • isVoid
  • key
  • object
  • nodes
  • type
  • Computed Properties
  • text
  • Static Methods
  • Inline.create
  • Inline.createList
  • Inline.fromJSON
  • Inline.isInline
  • Node Methods
  • Instance Methods
  • toJSON
  1. Slate Core

Inline

PreviousDocumentNextMark

Last updated 7 years ago

import { Inline } from 'slate'

A inline node in a Slate . Inline nodes implement the interface.

Inline nodes may contain nested inline nodes and text nodes—just like in the DOM. They always contain at least one text node child.

Properties

Inline({
  data: Data,
  isVoid: Boolean,
  key: String,
  nodes: Immutable.List<Node>,
  type: String
})

data

Immutable.Map

Arbitrary data associated with the node. Defaults to an empty Map.

isVoid

Boolean

Whether the node is a "void" node, meaning that it has no child content (eg. emoji, icons, etc.). Defaults to false.

key

String

A unique identifier for the node.

object

String

nodes

Immutable.List

A list of child nodes. Defaults to a list with a single text node child.

type

String

The custom type of the node (eg. link or hashtag).

Computed Properties

text

String

Static Methods

Inline.create

Inline.create(properties: Object) => Inline

Create an inline from a plain Javascript object of properties.

Inline.createList

Inline.createList(array: Array) => List

Create a list of inline nodes from a plain Javascript array.

Inline.fromJSON

Inline.fromJSON(object: Object) => Inline

Create an inline from a JSON object.

Inline.isInline

Inline.isInline(maybeInline: Any) => Boolean

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

Node Methods

Instance Methods

toJSON

toJSON() => Object

Returns a JSON representation of the inline.

Note that even though a node may be "void", it will still contain a single, empty node for consistency across other operations. However, when rendered by Slate that single node will not be visible.

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

A concatenated string of all of the descendant nodes of this node.

Inlines implement the interface. For information about all of the node methods, see the .

Document
Node
Text
Text
Block
Text
Text
Node
Node reference