@writergate/quill-image-uploader-nextjs 0.0.10 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/quill.imageUploader.js +4 -20
package/package.json
CHANGED
@@ -28,29 +28,13 @@ class ImageUploader {
|
|
28
28
|
const formats = this.quill.getFormat(range);
|
29
29
|
// if its not a code-block yet, turn it into one.
|
30
30
|
if (!formats['code-block']) {
|
31
|
-
return this.quill.
|
31
|
+
return this.quill.formatLine(range.index, range.length, 'code-block', 'user');
|
32
32
|
};
|
33
33
|
|
34
34
|
// if it was a code-block, and the user meant to remove it
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
let nodes = [domNode];
|
39
|
-
|
40
|
-
while (nodes.length > 0) {
|
41
|
-
const node = nodes.shift();
|
42
|
-
// first append children to queue
|
43
|
-
nodes = nodes.concat(Array.from(node.children));
|
44
|
-
|
45
|
-
// go through class list of current node removing its "hljs" classes
|
46
|
-
for (let i = 0; i < node.classList.length; i++) {
|
47
|
-
const c = node.classList[i];
|
48
|
-
if (c.indexOf('hljs') >= 0) {
|
49
|
-
node.classList.remove(c);
|
50
|
-
i--;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
}
|
35
|
+
this.quill.removeFormat(range.index, range.length, 'user');
|
36
|
+
// running it twise to remove colors
|
37
|
+
this.quill.removeFormat(range.index, range.length, 'user');
|
54
38
|
}
|
55
39
|
|
56
40
|
selectLocalImage() {
|