UNPKG

408 BJavaScriptView Raw
1import Parchment from 'parchment';
2
3
4class 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}
25Break.blotName = 'break';
26Break.tagName = 'BR';
27
28
29export default Break;