UNPKG

460 BJavaScriptView Raw
1import Embed from '../blots/embed';
2
3
4class 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}
17Mention.blotName = 'mention';
18Mention.className = 'ql-mention';
19Mention.tagName = 'A';
20
21
22export default Mention;