1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 06:53:25 +02:00

fix documentation references for "fragments", closes #228

This commit is contained in:
Ian Storm Taylor
2016-08-07 13:13:06 -07:00
parent 3128c26b82
commit f17629a42d
4 changed files with 8 additions and 6 deletions

View File

@@ -5,10 +5,12 @@
import { Document } from 'slate'
```
The top-level node in Slate.
The top-level node in Slate's document model.
Documents are made up of block nodes, inline nodes, and text nodes—just like in the DOM.
In some places, you'll see mention of "fragments", which are also `Document` objects, just that aren't attached to the main `State`. For example, when cutting-and-pasting a selection of content, that content will be referred to as a document "fragment".
- [Properties](#properties)
- [`nodes`](#nodes)
- [Computed Properties](#computed-properties)

View File

@@ -109,7 +109,7 @@ Insert a new block at the same level as the current block, splitting the current
### `insertFragment`
`insertFragment(fragment: Document) => Transform`
Insert a `fragment` at the current selection. If the selection is expanded, it will be deleted first.
Insert a [`fragment`](./document.md) at the current selection. If the selection is expanded, it will be deleted first.
### `insertInline`
`insertInline(inline: Inline) => Transform`
@@ -290,7 +290,7 @@ Insert a new block at the same level as the leaf block at a `range`, splitting t
### `insertFragmentAtRange`
`insertFragmentAtRange(range: Selection, fragment: Document) => Transform`
Insert a `fragment` at a `range`. If the selection is expanded, it will be deleted first.
Insert a [`fragment`](./document.md) at a `range`. If the selection is expanded, it will be deleted first.
### `insertInlineAtRange`
`insertInlineAtRange(range: Selection, inline: Inline) => Transform`

View File

@@ -785,7 +785,7 @@ class State extends new Record(DEFAULTS) {
/**
* Insert a `fragment` at the current selection.
*
* @param {List} fragment
* @param {Document} fragment
* @return {State} state
*/

View File

@@ -294,7 +294,7 @@ const Transforms = {
* Insert a `fragment` at a `range`.
*
* @param {Selection} range
* @param {List} fragment
* @param {Document} fragment
* @return {Node} node
*/