Skip to content

Conversation

@sosie-js
Copy link

//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

  var strWindowFeatures = "location=no,height=570,width=800,scrollbars=yes,status=yes";
    var childWindow= window.open('', "_blank", strWindowFeatures);
    childWindow.document.write("<pre>"+JSON.stringify(this.data, null, 4 ) +"</pre>");
    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

//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("<pre>"+JSON.stringify(this.data, null, 4 ) +"</pre>");
    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant