-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
OutputData is wrongly manipulated and does not match expected output #1072
Comments
Hi @natterstefan |
Hi and you're welcome @gohabereg. Do you think this can be resolved pretty easily and quickly or is this something big? |
Should not be too big, I will provide some details later |
Thank you very much @gohabereg. |
Thanks for the reminder :) A method that sanitizes blocks after save called is here — https://github.com/codex-team/editor.js/blob/master/src/components/modules/sanitizer.ts#L59 As you can see, if there is no sanitize config of any kind, it returns data as it is. But the problem is there is always sanitize config for inline-tools as this method appends The solution is actually simple — if a tool doesn't provide The second step would be to decode HTML entities after sanitize, but as we include inline tags to Editor's output, it would break the markup |
Hi @gohabereg, Okay, sounds doable. Is this a topic you gonna fix in editorjs itself, or is this something a user of the lib must fix individually? Would you mind updating the attached codepen and show me how one would solve it, please? Both steps ( |
Hi @natterstefan, It should be fixed in the editor itself |
Any update or workaround on this ? |
is there any update on this? |
any update? is there a workaround? |
I tried to understand the problem. The behavior changed with #1016. As @gohabereg said, this triggers the sanitizer even when there is no sanitizer config . Actually I don't think this is really a bug. |
Current Setup
Documented and prepared in this codesandbox example.
Note: It doesn't matter if this is tested with or without react (I've prepared both, see links below)
Current Setup
Let's assume I've a the following data object:
When passing this later on to EditorJS everything works fine (note: tested in a react setup, but it does not really matter if it's plain js or not).
Current Problem
When I now get the data from the editor with
await editor.save()
the data is corrupt and looks like this:remote.adjust.rotate=0&
vs.remote.adjust.rotate=0&remote...
:/This only happens since
@editorjs/[email protected]
in the latest2.16
release everything works still (see codesandbox with2.16.1
).Example Apps
The text was updated successfully, but these errors were encountered: