slate-edit-blockquote
A Slate plugin to handle keyboard events in blockquotes.
Last updated 3 years ago by samypesse .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install 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.

Install

npm install 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 '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(change: Change) => Change

Wrap current block in a new blockquote.

changes.unwrapBlockquote

plugin.changes.unwrapBlockquote(change: Change) => Change

Unwrap from current blockquote if any.

Current Tags

  • 0.6.1                                ...           latest (3 years ago)

9 Versions

  • 0.6.1                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.5.0                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Downloads
Today 0
This Week 46
This Month 0
Last Day 2
Last Week 83
Last Month 267
Dependencies (0)
None
Dev Dependencies (25)

Copyright 2014 - 2016 © taobao.org |