Liyuan Li 5 years ago
parent
commit
b4d1633d96
3 changed files with 9 additions and 0 deletions
  1. 2 0
      CHANGELOG.md
  2. 3 0
      src/ts/ir/index.ts
  3. 4 0
      src/ts/wysiwyg/index.ts

+ 2 - 0
CHANGELOG.md

@@ -51,6 +51,8 @@
 
 ### v3.0.9 / 2020-04-0x
 
+* [253](https://github.com/Vanessa219/vditor/issues/253) 所见即所得复制粘贴问题 `修复缺陷`
+
 ### v3.0.8 / 2020-04-02
 
 * [261](https://github.com/Vanessa219/vditor/issues/261) When link with "" and ctrl+k `修复缺陷`

+ 3 - 0
src/ts/ir/index.ts

@@ -103,6 +103,9 @@ class IR {
                     tempElement.querySelectorAll("[style]").forEach((e) => {
                         e.removeAttribute("style");
                     });
+                    tempElement.querySelectorAll(".vditor-copy").forEach((e) => {
+                        e.remove();
+                    });
                     vditor.lute.SetJSRenderers({
                         renderers: {
                             HTML2VditorIRDOM: {

+ 4 - 0
src/ts/wysiwyg/index.ts

@@ -168,6 +168,10 @@ class WYSIWYG {
                     tempElement.querySelectorAll("[style]").forEach((e) => {
                         e.removeAttribute("style");
                     });
+                    tempElement.querySelectorAll(".vditor-copy").forEach((e) => {
+                        e.remove();
+                    });
+
                     vditor.lute.SetJSRenderers({
                         renderers: {
                             HTML2VditorDOM: {