Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.url cache bug changes the value internally on 3rd save() call triggered with editor.js.save() #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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