-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Description
I'm getting out of ideas. After trying for an eternity I'd like to ask directly how it's possible to add a blot in Angular.
I want the user to be able to annotate text. Ideally it would be possible to add overlapping annotation but I'd be happy if adding a simple blot would work for a start.
I'm essentially creating an Annotation:
import {InlineBlot} from "parchment";
import * as QuillNamespace from 'quill';
let Quill: any = QuillNamespace;
class Annotation extends InlineBlot {
blotName = "annotation";
tagName = "SPAN";
className = "annotation-class";
static create(node: Node){
console.log("CREATE");
return node;
}
static formats() {
return true as any;
}
}
Quill.register(Annotation, true);which I try to add like this:
this.quill.on('selection-change', function(range: RangeStatic) {
if (range) {
if (range.length > 0) {
quill.formatText(range, Annotation.tagName, true);
}
}
});However, nothing really happens. There's nothing crashing but there's nothing added as well.
What am I missing here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels