mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-17 21:49:20 +01:00
update readme, fix tables example
This commit is contained in:
parent
7dc00a77d3
commit
dae23d5bd2
12
Readme.md
12
Readme.md
@ -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.
|
||||
- [**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.
|
||||
- [**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.
|
||||
- [**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!
|
||||
|
||||
@ -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).
|
||||
|
||||
- [**Getting Started**](docs/getting-started.md)
|
||||
- [**Core Concepts**](docs/concepts.md)
|
||||
- [Stateless & Immutability](docs/getting-started.md#stateless-immutability)
|
||||
- **Core Concepts**
|
||||
- Statelessness & Immutability
|
||||
- [The Document Model](docs/getting-started.md#the-document-model)
|
||||
- Selections
|
||||
- [**API Reference**](docs/reference.md)
|
||||
- The Selection Model
|
||||
- Writing Plugins
|
||||
- **API Reference**
|
||||
- Plugins
|
||||
- Components
|
||||
- Editor
|
||||
|
@ -83,7 +83,7 @@ class Tables extends React.Component {
|
||||
*/
|
||||
|
||||
onKeyDown(e, state) {
|
||||
if (state.startNode.type != 'table-cell') return
|
||||
if (state.startBlock.type != 'table-cell') return
|
||||
|
||||
const key = keycode(e.which)
|
||||
switch (key) {
|
||||
@ -116,7 +116,7 @@ class Tables extends React.Component {
|
||||
*/
|
||||
|
||||
onDelete(e, state) {
|
||||
if (state.endOffset != state.startNode.length) return
|
||||
if (state.endOffset != state.startText.length) return
|
||||
e.preventDefault()
|
||||
return state
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user