UNPKG

451 BJavaScriptView Raw
1'use strict';
2
3var isList = require('./isList');
4
5/**
6 * Return the parent list block for an item block.
7 *
8 * @param {PluginOptions} opts
9 * @param {Slate.Value} value
10 * @param {Slate.Block} item
11 * @return {Slate.Block || Void}
12 */
13function getListForItem(opts, value, item) {
14 var document = value.document;
15
16 var parent = document.getParent(item.key);
17 return parent && isList(opts, parent) ? parent : null;
18}
19
20module.exports = getListForItem;
\No newline at end of file