forked from GitbookIO/slate-edit-list
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalue.js
More file actions
54 lines (52 loc) · 1.98 KB
/
Copy pathvalue.js
File metadata and controls
54 lines (52 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/** @jsx h */
// eslint-disable-next-line import/no-extraneous-dependencies
import { createHyperscript } from '@gitbook/slate-hyperscript';
const h = createHyperscript({
blocks: {
heading: 'heading',
paragraph: 'paragraph',
ul_list: 'ul_list',
ol_list: 'ol_list',
list_item: 'list_item'
}
});
export default (
<value>
<document>
<heading>Slate + List Edition</heading>
<paragraph>
This page is a basic example of Slate + slate-edit-list plugin.
Press Enter in a list to create a new list item. Press Enter
again to exit and Shift+Enter to create a paragraph in a list.
The items at range are detected and highlighted, for
demonstration purpose.
</paragraph>
<ul_list style={{ listStyleType: 'disc' }}>
<list_item>
<paragraph>First item in the list</paragraph>
</list_item>
<list_item>
<paragraph>List item can contain blocks</paragraph>
<heading>Here is a heading</heading>
<paragraph>And another paragraph</paragraph>
</list_item>
<list_item>
<paragraph>
Third item in the list, with a nested list
</paragraph>
<ol_list style={{ listStyleType: 'decimal' }}>
<list_item>
<paragraph>First item in the nested list</paragraph>
</list_item>
<list_item>
<paragraph>
Second item in the nested list
</paragraph>
</list_item>
</ol_list>
</list_item>
</ul_list>
<paragraph>End paragraph</paragraph>
</document>
</value>
);