1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 12:30:11 +02:00

update readme, fix tables example

This commit is contained in:
Ian Storm Taylor
2016-07-06 15:13:15 -07:00
parent 7dc00a77d3
commit dae23d5bd2
2 changed files with 10 additions and 6 deletions

View File

@@ -36,8 +36,11 @@ To get a sense for how you might use Slate, check out a few of the examples:
- [**Rich text**](examples/rich-text) — showing the features you'd expect from a basic editor. - [**Rich text**](examples/rich-text) — showing the features you'd expect from a basic editor.
- [**Auto-markdown**](examples/auto-markdown) — showing how to add key handlers for Markdown-like shortcuts. - [**Auto-markdown**](examples/auto-markdown) — showing how to add key handlers for Markdown-like shortcuts.
- [**Links**](examples/links) — showing how wrap text in inline nodes with associated data. - [**Links**](examples/links) — showing how wrap text in inline nodes with associated data.
- [**Images**](examples/images) — showing how to use void (text-less) nodes to add images.
- [**Hovering menu**](examples/hovering-menu) — showing how a contextual hovering menu can be implemented. - [**Hovering menu**](examples/hovering-menu) — showing how a contextual hovering menu can be implemented.
- [**Tables**](examples/tables) — showing how to nest blocks to render more advanced components. - [**Tables**](examples/tables) — showing how to nest blocks to render more advanced components.
- [**Paste HTML**](examples/paste-html) — showing how to use an HTML serializer to handle pasted HTML.
- [**Code Highlighting**](examples/code-highlighting) — showing how to use decorators to dynamically mark text.
If you have an idea for an example that shows a common use case, pull request it! If you have an idea for an example that shows a common use case, pull request it!
@@ -47,11 +50,12 @@ If you have an idea for an example that shows a common use case, pull request it
If you're using Slate for the first time, check out the [Getting Started](docs/getting-started.md) guide to familiarize yourself with Slate's architecture and mental models. After that, you'll probably just want the [API Reference](docs/reference.md). If you're using Slate for the first time, check out the [Getting Started](docs/getting-started.md) guide to familiarize yourself with Slate's architecture and mental models. After that, you'll probably just want the [API Reference](docs/reference.md).
- [**Getting Started**](docs/getting-started.md) - [**Getting Started**](docs/getting-started.md)
- [**Core Concepts**](docs/concepts.md) - **Core Concepts**
- [Stateless & Immutability](docs/getting-started.md#stateless-immutability) - Statelessness & Immutability
- [The Document Model](docs/getting-started.md#the-document-model) - [The Document Model](docs/getting-started.md#the-document-model)
- Selections - The Selection Model
- [**API Reference**](docs/reference.md) - Writing Plugins
- **API Reference**
- Plugins - Plugins
- Components - Components
- Editor - Editor

View File

@@ -83,7 +83,7 @@ class Tables extends React.Component {
*/ */
onKeyDown(e, state) { onKeyDown(e, state) {
if (state.startNode.type != 'table-cell') return if (state.startBlock.type != 'table-cell') return
const key = keycode(e.which) const key = keycode(e.which)
switch (key) { switch (key) {
@@ -116,7 +116,7 @@ class Tables extends React.Component {
*/ */
onDelete(e, state) { onDelete(e, state) {
if (state.endOffset != state.startNode.length) return if (state.endOffset != state.startText.length) return
e.preventDefault() e.preventDefault()
return state return state
} }