1 | ;
|
2 |
|
3 | var getCurrentItem = require('./getCurrentItem');
|
4 | var getListForItem = require('./getListForItem');
|
5 |
|
6 | /**
|
7 | * Return the parent list block, from current selection or from a node (paragraph in a list item).
|
8 | *
|
9 | * @param {PluginOptions} opts
|
10 | * @param {Slate.Value} value
|
11 | * @param {Slate.Block} block?
|
12 | * @return {Slate.Block || Void}
|
13 | */
|
14 | function getCurrentList(opts, value, block) {
|
15 | var item = getCurrentItem(opts, value, block);
|
16 |
|
17 | if (!item) {
|
18 | return null;
|
19 | }
|
20 |
|
21 | return getListForItem(opts, value, item);
|
22 | }
|
23 |
|
24 | module.exports = getCurrentList; |
\ | No newline at end of file |