@writergate/quill-image-uploader-nextjs 0.0.9 → 0.0.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@writergate/quill-image-uploader-nextjs",
3
- "version": "0.0.9",
3
+ "version": "0.0.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/enlear/quill-image-uploader-nextjs.git"
@@ -28,29 +28,11 @@ 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.format(range.index, 'code-block', 'user');
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
- // then do all the work we did up top in the keybinding function
36
- this.quill.format(range.index, 'code-block', false, 'user');
37
- const { domNode } = this.quill.getLine(range.index)[0];
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');
54
36
  }
55
37
 
56
38
  selectLocalImage() {