slate-lists-plugin

a plugin for handling lists in Slate

Usage no npm install needed!

<script type="module">
  import slateListsPlugin from 'https://cdn.skypack.dev/slate-lists-plugin';
</script>

README

slate-lists-plugin

A plugin for Slate for handling keyboard events when in a list.

To use

import ListsPlugin from 'slate-lists-plugin';

const plugins = [
  ListsPlugin(options)
]

Arguments

The list plugin takes an options object.

  • types - an array of strings for the type of list e.g ['my-ordered-list', 'my-unordered-list']
  • typeItem - a string of the type of a list item 'my-list-item'

Keys

  • Enter will insert a new list item
  • Enter + shift will allow for multi-line list items
  • Tab will nest a list item
  • Tab + shift will un nest a list item
  • Backspace will unwrap the list item if at the beginning of the item