1 | import Parchment from 'parchment';
|
2 |
|
3 |
|
4 | class Break extends Parchment.Embed {
|
5 | static value() {
|
6 | return undefined;
|
7 | }
|
8 |
|
9 | insertInto(parent, ref) {
|
10 | if (parent.children.length === 0) {
|
11 | super.insertInto(parent, ref);
|
12 | } else {
|
13 | this.remove();
|
14 | }
|
15 | }
|
16 |
|
17 | length() {
|
18 | return 0;
|
19 | }
|
20 |
|
21 | value() {
|
22 | return '';
|
23 | }
|
24 | }
|
25 | Break.blotName = 'break';
|
26 | Break.tagName = 'BR';
|
27 |
|
28 |
|
29 | export default Break;
|