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
  • object
  • type
  • Static Methods
  • Mark.create
  • Mark.createSet
  • Mark.fromJSON
  • Mark.isMark
  • Instance Methods
  • toJSON
  1. Slate Core

Mark

PreviousInlineNextNode

Last updated 7 years ago

import { Mark } from 'slate'

A formatting mark that can be associated with . Marks are how Slate represents rich formatting like bold or italic.

Properties

Mark({
  data: Data,
  type: String,
})

data

Data

A map of .

object

String

A string with a value of 'mark'.

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.

Mark.fromJSON

Mark.fromJSON(object: Object) => Mark

Create a mark from a JSON object.

Mark.isMark

Mark.isMark(maybeMark: Any) => Boolean

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

Instance Methods

toJSON

toJSON() => Object

Returns a JSON representation of the mark.

Characters
Data