Browse Source

:lock: https://github.com/Vanessa219/vditor/issues/1085

Vanessa 4 năm trước cách đây
mục cha
commit
1b2382d7f8
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 1 1
      src/ts/util/fixBrowserBehavior.ts
  2. 3 0
      types/index.d.ts

+ 1 - 1
src/ts/util/fixBrowserBehavior.ts

@@ -1355,7 +1355,7 @@ export const paste = async (vditor: IVditor, event: (ClipboardEvent | DragEvent)
     if (doc.body) {
         textHTML = doc.body.innerHTML;
     }
-
+    textHTML = Lute.Sanitize(textHTML);
     vditor.wysiwyg.getComments(vditor);
 
     // process code

+ 3 - 0
types/index.d.ts

@@ -118,6 +118,8 @@ declare class Lute {
 
     public static NewNodeID(): string;
 
+    public static Sanitize(html: string): string;
+
     private constructor();
 
     public SetJSRenderers(options?: {
@@ -232,6 +234,7 @@ declare const webkitAudioContext: {
 
 interface ITips {
     [index: string]: string;
+
     alignCenter: string;
     alignLeft: string;
     alignRight: string;