UNPKG

685 BJavaScriptView Raw
1export var placeholder = {
2 inline: true,
3 group: 'inline',
4 selectable: false,
5 marks: '',
6 attrs: {
7 text: { default: '' },
8 },
9 parseDOM: [
10 {
11 tag: 'span[data-placeholder]',
12 getAttrs: function (dom) { return ({
13 text: dom.getAttribute('data-placeholder') ||
14 placeholder.attrs.text.default,
15 }); },
16 },
17 ],
18 toDOM: function (node) {
19 var text = node.attrs.text;
20 var attrs = {
21 'data-placeholder': text,
22 contenteditable: 'false',
23 };
24 return ['span', attrs, text];
25 },
26};
27//# sourceMappingURL=placeholder.js.map
\No newline at end of file