bludit/bl-plugins/quill/quill-1.3.6/mention.js
2018-10-18 19:21:57 +02:00

21 lines
460 B
JavaScript
Executable File

import Embed from '../blots/embed';
class Mention extends Embed {
static create(value) {
const node = super.create(value);
node.setAttribute('data-id', value);
node.setAttribute('href', `/${value}`);
node.textContent = '@quilljs';
return node;
}
static value(domNode) {
return domNode.getAttribute('data-id');
}
}
Mention.blotName = 'mention';
Mention.className = 'ql-mention';
Mention.tagName = 'A';
export default Mention;