Skip to content

register embed blot will effect all quill instance #3885

@neeko-iweurow

Description

@neeko-iweurow

There are two 'new quill' in my project, quill1 need insert the CustomHtmlBlot, quill2 needn't
when Quill.register(CustomHtmlBlot)

Steps for Reproduction

`
class CustomHtmlBlot extends Quill.import("blots/block/embed") {
static create(value: string) {
let node = super.create(value);
node.innerHTML = DOMPurify.sanitize(value, {
FORBID_TAGS: ["style"],
});
return node;
}
static value(node: HTMLElement) {
return node.innerHTML;
}
}
CustomHtmlBlot.tagName = "DIV";
CustomHtmlBlot.blotName = "custom-html-blot";
Quill.register(CustomHtmlBlot);

const quill1 = new Quill(el, {
theme: "snow",
formats: ['custom-html-blot'],
})

const quill2 = new Quill(el, {
theme: "snow",
formats: [],
})
`

Expected behavior:
The quill2 can paste the text which copy from vscode or notes

Actual behavior:
The quill2 instance couldn't paste the text which copy from vscode or notes
The quill1 can edit the blot content
Platforms:
chrome

Version:
1.3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions