1 | ;
|
2 |
|
3 | var 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 | */
|
13 | function 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 |
|
20 | module.exports = getListForItem; |
\ | No newline at end of file |