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

Soft line break issue: Chrome VS safari #2522

Open
xkzl opened this issue Oct 25, 2023 · 5 comments
Open

Soft line break issue: Chrome VS safari #2522

xkzl opened this issue Oct 25, 2023 · 5 comments
Labels

Comments

@xkzl
Copy link

xkzl commented Oct 25, 2023

Hi @neSpecc
I have EditorJS 2.28 and I noticed a difference in behavior between Safari and Chrome.
When making a soft line break, safari is returning a <div> block while chrome is returning a <br>

  1. Open a new EditorJS instance
  2. Write some text and make a soft line break: Enter+Shift

The main issue behind this behavior is that the <div> gets sanitized and the carriage return disappear.

@xkzl xkzl added the bug label Oct 25, 2023
@xkzl
Copy link
Author

xkzl commented Feb 5, 2024

Safari:
safari

Chrome:
chrome

@xkzl
Copy link
Author

xkzl commented Feb 5, 2024

@neSpecc @n0str @talyguryn
I updated to EditorJS 2.29 and I am still facing this issue. Is there any plan to get this issue fixed ??
Do you have any clue the reason behind such behaviors ?

I think many people might be facing this and the editor navigation is breaking due to this <div> in Safari. :(

@xkzl
Copy link
Author

xkzl commented Feb 5, 2024

@neSpecc I think the issue also shows in the demo page here: https://editorjs.io

@neSpecc
Copy link
Member

neSpecc commented Feb 5, 2024

I see. You can add "div" to your sanitiser config as a workaround.

@xkzl
Copy link
Author

xkzl commented Feb 10, 2024

@neSpecc @n0str @talyguryn I see. Yes, agreed that allows for breaking lines.
But what about the navigation ?? This is the main broken part.

In my previous example, putting the caret at the beginning of "Curabitur" and going up with the upper arrow breaks navigation and goes straight to the end of "lobortis urea". Therefore the navigation on the paragraph in-between is missing. Moreover, the trying to use backspace results in a weird merging or paragraphs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants