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

White space getting removed #4863

Open
RamKumarVirivada opened this issue Jan 6, 2025 · 0 comments
Open

White space getting removed #4863

RamKumarVirivada opened this issue Jan 6, 2025 · 0 comments

Comments

@RamKumarVirivada
Copy link

Bug Description

Issue: Whitespace after an inline element (e.g., ) within a nested structure (e.g., ordered/unordered lists) is unexpectedly removed during editing or rendering. This causes the text to appear concatenated without proper spacing, leading to formatting inconsistencies.


Steps to Reproduce

  1. Open the WYSIWYG editor.
  2. Create a nested list (e.g., ul or ol).
  3. Add an inline element (e.g., span) within a list item.
  4. Add text immediately after the inline element with a space in between.
  5. Save or switch to code view.

CodeSandbox

Or check the example provided below from CodeSandbox
https://codesandbox.io/p/devbox/froala-angular-wysiwyg-editor-forked-wm6rzw

editorContent =
    '<ol><li><strong><span spellcheck="false">One</span>:</strong>&nbsp;<ol><li>Space issue.<strong>&nbsp;</strong><span spellcheck="false">Space before</span> Space after<ul></ul></li></ol></li></ol><p><br></p>';

Expected Behavior

The editor should preserve the whitespace after the inline element, ensuring correct text rendering. For example:

  • Example text
  • should display as Example text.

    Actual Behavior

    The whitespace after the inline element is removed, and the resulting text appears concatenated:

  • Exampletext
  • displays as Exampletext.

    Environment

    • Editor Version: 4.1.1
    • Browser: Chrome 131
    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

    No branches or pull requests

    1 participant