Browse Source

:bug: https://github.com/Vanessa219/vditor/issues/1738

Vanessa 10 months ago
parent
commit
110628c302
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/ts/undo/index.ts

+ 5 - 1
src/ts/undo/index.ts

@@ -152,7 +152,11 @@ class Undo {
             vditor[vditor.currentMode].element.querySelectorAll(`.vditor-${vditor.currentMode}__preview`)
                 .forEach((blockElement: HTMLElement) => {
                     if (blockElement.parentElement.querySelector(".language-echarts")) {
-                        blockElement.parentElement.outerHTML = vditor.lute.SpinVditorDOM(blockElement.parentElement.outerHTML);
+                        if (vditor.currentMode ==="ir") {
+                            blockElement.parentElement.outerHTML = vditor.lute.SpinVditorIRDOM(blockElement.parentElement.outerHTML);
+                        } else {
+                            blockElement.parentElement.outerHTML = vditor.lute.SpinVditorDOM(blockElement.parentElement.outerHTML);
+                        }
                     }
                 });
             vditor[vditor.currentMode].element.querySelectorAll(`.vditor-${vditor.currentMode}__preview[data-render='2']`)