1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-11 17:53:59 +02:00

Fix a few typos in the docs (#5463)

* fix: typo in with-react docs

* fix: typo in range docs

* fix: typo in faq docs

* fix: typo in react-editor docs
This commit is contained in:
Ben Dahl
2023-06-30 00:03:00 -07:00
committed by GitHub
parent 4bd15ed395
commit 711c2298dd
4 changed files with 4 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ Check if a `range` is exactly equal to `another`.
Check if a `range` includes a path, a point, or part of another range. Check if a `range` includes a path, a point, or part of another range.
For clarity the definition of `includes` can mean partially includes. Another way to describe this is if one Range intersectns the other Range. For clarity the definition of `includes` can mean partially includes. Another way to describe this is if one Range intersects the other Range.
#### `Range.isBackward(range: Range) => boolean` #### `Range.isBackward(range: Range) => boolean`

View File

@@ -9,7 +9,7 @@ A series of common questions people have about Slate:
One of Slate's core principles is that, unlike most other editors, it does **not** prescribe a specific "schema" to the content you are editing. This means that Slate's core has no concept of "block quotes" or "bold formatting". One of Slate's core principles is that, unlike most other editors, it does **not** prescribe a specific "schema" to the content you are editing. This means that Slate's core has no concept of "block quotes" or "bold formatting".
For the most part, this leads to increased flexbility without many downsides, but there are certain cases where you have to do a bit more work. Pasting is one of those cases. For the most part, this leads to increased flexibility without many downsides, but there are certain cases where you have to do a bit more work. Pasting is one of those cases.
Since Slate knows nothing about your domain, it can't know how to parse pasted HTML content \(or other content\). So, by default whenever a user pastes content into a Slate editor, it will parse it as plain text. If you want it to be smarter about pasted content, you need to override the `insert_data` command and deserialize the `DataTransfer` object's `text/html` data as you wish. Since Slate knows nothing about your domain, it can't know how to parse pasted HTML content \(or other content\). So, by default whenever a user pastes content into a Slate editor, it will parse it as plain text. If you want it to be smarter about pasted content, you need to override the `insert_data` command and deserialize the `DataTransfer` object's `text/html` data as you wish.

View File

@@ -10,7 +10,7 @@ const [editor] = useState(() => withReact(withHistory(createEditor())))
- [Check methods](react-editor.md#check-methods) - [Check methods](react-editor.md#check-methods)
- [Focus and selection methods](react-editor.md#focus-and-selection-methods) - [Focus and selection methods](react-editor.md#focus-and-selection-methods)
- [DOM translation methods](react-editor.md#dom-translation-methods) - [DOM translation methods](react-editor.md#dom-translation-methods)
- [DataTranfer methods](react-editor.md#datatransfer-methods) - [DataTransfer methods](react-editor.md#datatransfer-methods)
## Static methods ## Static methods

View File

@@ -14,4 +14,4 @@ const [editor] = useState(() => withReact(withHistory(createEditor())))
The `clipboardFormatKey` option allows you to customize the `DataTransfer` type when Slate data is copied to the clipboard. By default, it is `application/x-slate-fragment` but it can be customized using this option. The `clipboardFormatKey` option allows you to customize the `DataTransfer` type when Slate data is copied to the clipboard. By default, it is `application/x-slate-fragment` but it can be customized using this option.
This can be useful when a user copies from one Slate editor to a differently configured Slate editor. This could cause nodes to be inserted which are not correctly typed for the receiving editor, corrupting the document. By customizing the `clipboardFormatKey` one can ensure that the raw JSON data isn't cpied between editors with different schemas. This can be useful when a user copies from one Slate editor to a differently configured Slate editor. This could cause nodes to be inserted which are not correctly typed for the receiving editor, corrupting the document. By customizing the `clipboardFormatKey` one can ensure that the raw JSON data isn't copied between editors with different schemas.