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

Recursive insertion of &nbsp; (non-breaking space) character because of spaces around <br> (break) tag #14680

Closed
jameslpetersen opened this issue Jul 27, 2023 · 4 comments
Labels
package:source-editing resolution:resolved This issue was already resolved (e.g. by another ticket). squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jameslpetersen
Copy link

📝 Provide detailed reproduction steps (if any)

  1. Paste the following HTML when the editor is in source mode:
    <p>Hello <br> World</p>
  2. Switch out of and back into source mode

✔️ Expected result

What is the expected result of the above steps?

<p>
    Hello
    <br>
    World
</p>

❌ Actual result

What is the actual result of the above steps?

<p>
    Hello&nbsp;
    <br>
    World
</p>

Furthermore, the above HTML will re-trigger the bug when you re-open the editor and switch to source mode. This will lead to multiple   (non-breaking space) tags in the HTML when the user does not want or need them.

📃 Other details

  • Browser: Chrome
  • OS: Windows
  • First affected CKEditor version: 5
  • Installed CKEditor plugins: None. This happens in the reference implementation.
@jameslpetersen jameslpetersen added the type:bug This issue reports a buggy (incorrect) behavior. label Jul 27, 2023
@niegowski
Copy link
Contributor

This issue should be fixed by #14406. It was recently merged and should be released soon.

@wimleers
Copy link

Wonderful news, @niegowski! This was just independently reported in Drupal too! 🤓

https://www.drupal.org/project/drupal/issues/3377652#comment-15170239

@Witoso
Copy link
Member

Witoso commented Jul 31, 2023

I confirm that recursive behavior doesn't happen on the master (check the nightly docs) but nbsp will be inserted. I guess this is added to allow editing the content before the br. Closing for now, as the issue reported the recursive behavior.

@Witoso Witoso closed this as completed Jul 31, 2023
@Witoso Witoso added the resolution:resolved This issue was already resolved (e.g. by another ticket). label Jul 31, 2023
@Witoso Witoso added this to the iteration 65 milestone Jul 31, 2023
@Witoso Witoso added squad:core Issue to be handled by the Core team. package:source-editing labels Jul 31, 2023
@raq007
Copy link

raq007 commented Mar 29, 2024

Hi @Witoso is there a way to avoid the single nbsp also ? I am trying to match with CKEDitor 4 behaviour so any workaround would be really appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:source-editing resolution:resolved This issue was already resolved (e.g. by another ticket). squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

5 participants