1 | import Embed from '../blots/embed';
|
2 |
|
3 |
|
4 | class Mention extends Embed {
|
5 | static create(value) {
|
6 | let node = super.create(value);
|
7 | node.setAttribute('data-id', value);
|
8 | node.setAttribute('href', '/' + value);
|
9 | node.textContent = '@quilljs';
|
10 | return node;
|
11 | }
|
12 |
|
13 | static value(domNode) {
|
14 | return domNode.getAttribute('data-id');
|
15 | }
|
16 | }
|
17 | Mention.blotName = 'mention';
|
18 | Mention.className = 'ql-mention';
|
19 | Mention.tagName = 'A';
|
20 |
|
21 |
|
22 | export default Mention;
|