MCPcopy
hub / github.com/ianstormtaylor/slate / insertText

Method insertText

packages/slate/src/models/text.js:261–266  ·  view source on GitHub ↗

* Insert `text` at `index`. * * @param {Number} index * @param {String} string * @return {Text}

(index, string)

Source from the content-addressed store, hash-verified

259 */
260
261 insertText(index, string) {
262 const { text } = this
263 const next = text.slice(0, index) + string + text.slice(index)
264 const node = this.set('text', next)
265 return node
266 }
267
268 /**
269 * Remove a `mark`.

Calls

no outgoing calls

Tested by

no test coverage detected