@team-monolith/cds 0.29.18 → 0.29.19

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.
@@ -22,6 +22,11 @@ export declare class Raw extends EditorJSRaw {
22
22
  icon: string;
23
23
  title: string;
24
24
  };
25
+ static get sanitize(): {
26
+ html: boolean;
27
+ code: boolean;
28
+ };
29
+ onPaste(event: any): void;
25
30
  static get pasteConfig(): {
26
31
  tags: string[];
27
32
  };
@@ -92,9 +92,21 @@ export class Raw extends EditorJSRaw {
92
92
  title: "Code",
93
93
  };
94
94
  }
95
+ static get sanitize() {
96
+ return {
97
+ html: true,
98
+ code: true, // Allow CODE tag
99
+ };
100
+ }
101
+ onPaste(event) {
102
+ const content = event.detail.data;
103
+ this.data = {
104
+ html: content.textContent,
105
+ };
106
+ }
95
107
  static get pasteConfig() {
96
108
  return {
97
- tags: ["CODE", "TEXTAREA"],
109
+ tags: ["pre", "CODE", "TEXTAREA"],
98
110
  };
99
111
  }
100
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "0.29.18",
3
+ "version": "0.29.19",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,