From f661f31835af0f7dbf59e713cb10e983c21934f7 Mon Sep 17 00:00:00 2001 From: SoSie <70700670+sosie-js@users.noreply.github.com> Date: Mon, 19 Oct 2020 16:39:35 +0200 Subject: [PATCH] Update index.js //image.src is not reliable, this was tracked using the editorjs-undo plugin in bigBrother mode If you add before the return line this code ```js var strWindowFeatures = "location=no,height=570,width=800,scrollbars=yes,status=yes"; var childWindow= window.open('', "_blank", strWindowFeatures); childWindow.document.write("
"+JSON.stringify(this.data, null, 4 ) +""); childWindow.focus(); ``` You will see that starting the 3rd click on editor.js.save() button from editor.js/src/editor.js/example/example-dev.html that the relative image path 'assets/codex2x.png' is being converted to http url such as http://localhost/editor.js/src/editor.js/example/assets/codex2x.png", this will be taken as a change and polluate the undo plugin --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 7d6b590..486bc8b 100644 --- a/src/index.js +++ b/src/index.js @@ -162,7 +162,7 @@ class SimpleImage { } return Object.assign(this.data, { - url: image.src, + url: this.data.url, caption: caption.innerHTML, }); }