@ebooker/slate-edit-blockquote
A Slate plugin to handle keyboard events in blockquotes.
Last updated a year ago by ebookchain .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ebooker/slate-edit-blockquote 
SYNC missed versions from official npm registry.

slate-edit-blockquote

NPM version Linux Build Status

A Slate plugin to handle keyboard events in blockquotes. Blockquotes can contain blocks.

⚠️ This repository is fork from GitBook's plugin, now using the master of ianstormtaylor/slate.

All the versions using Ebooker's fork of slate are now published under the @ebooker NPM scope. To learn more about why we forked Slate, read slate readme

Install

npm install @ebooker/slate-edit-blockquote

Features

Natural keybindings:

  • Pressing <kbd>Enter</kbd> in an empty block of a blockquote, exits the blockquote
  • Pressing <kbd>Backspace</kbd> at the start of a block in a blockquote, unwraps from the blockquote

Simple Usage

import EditBlockquote from '@ebooker/slate-edit-blockquote'

const plugins = [
  EditBlockquote()
]

Arguments

This plugin accepts options to redefine the following block types:

  • [type: String] — type for blockquotes
  • [typeDefault: String] — type for default block in blockquote.

Utilities

slate-edit-blockquote exports utilities and changes:

utils.isSelectionInBlockquote

plugin.utils.isSelectionInBlockquote(value: Value) => Boolean

Return true if selection is inside a blockquote (and it can be unwrap).

changes.wrapInBlockquote

plugin.changes.wrapInBlockquote(editor: Editor) => Editor

Wrap current block in a new blockquote.

changes.unwrapBlockquote

plugin.changes.unwrapBlockquote(editor: Editor) => Editor

Unwrap from current blockquote if any.

Current Tags

  • 0.6.2                                ...           latest (a year ago)

2 Versions

  • 0.6.2                                ...           a year ago
  • 0.6.1                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (25)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |