const Inline = Quill.import('blots/inline');
export class Track extends Inline {
static blotName = 'track';
static tagName = 'span';
static formats(node) {
return {
color: node.getAttribute('color'),
cid: node.getAttribute('cid'),
uid: node.getAttribute('uid'),
name: node.getAttribute('name')
};
}
static create({name, uid, cid, color}) {
const node = super.create();
node.setAttribute('name', name);
node.setAttribute('uid', uid);
node.setAttribute('cid', cid);
node.style.backgroundColor = color;
return node;
}
Quill.register(Track);
I have created a custom span blot for track changes for quill, but everytime there is a new user all the attributes i.e cid, uid, name remain consistent except the background color which gets inherited from the previous span blot. I cannot see suggestions of the new user in a different color, inspite of being a different span blot . How do I perform inline styling for different users in my custom made span blot ?. This is how I add authors in my code
author() {
this.trackChanges = !this.trackChanges;
const range = this.editor.quillEditor.getSelection();
if (range) {
if (this.trackChanges) {
this.editor.quillEditor.format('track', {name: this.name, uid: this.id, cid: this.chance.guid(), color: this.color});
}
}
}