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

nbsp characters are somehow trimmed from HTML which is set #4261

Open
memarko opened this issue Jun 19, 2024 · 0 comments
Open

nbsp characters are somehow trimmed from HTML which is set #4261

memarko opened this issue Jun 19, 2024 · 0 comments

Comments

@memarko
Copy link

memarko commented Jun 19, 2024

I found out that quill editor strips out   html tags if there is new line character inside.

Steps for Reproduction

I have HTML:
<p><span>&nbsp;&nbsp;&nbsp;</span>Test</p>
and
<p><span>&nbsp;&nbsp;&nbsp;\r\n</span>Test</p>
\r\n are non printable characters

Quill converts first html to:
---Test
where space is here shown as '-'.

And second one to:
Test
Which does not have any space before Test.

Platforms:

Browser is Edge version: 126.0.2592.61, OS is Windows 11

Version:
Quill.version = '2.0.2'

Workaround:
The workaround is to remove new line character to each &nbsp; so:
htmlString = htmlString.replaceAll("&nbsp;\n", "&nbsp;").replaceAll("\u00a0\n", "\u00a0")

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