-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Handle consecutive spaces when copying and pasting #4502
Conversation
79b6ed6
to
2e48505
Compare
2e48505
to
f2f3480
Compare
@@ -370,7 +370,8 @@ function convertHTML( | |||
return blot.html(index, length); | |||
} | |||
if (blot instanceof TextBlot) { | |||
return escapeText(blot.value().slice(index, index + length)); | |||
const escapedText = escapeText(blot.value().slice(index, index + length)); | |||
return escapedText.replaceAll(' ', ' '); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why was it necessary? I got an error after update because of this. The text I get from a quill instance using event.editor.getSemanticHTML()
now returns
instead of all spaces resulting in wrong behavior when I pass this string to another service, which renders it in PDF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are seeing the
on copy/pasting into the editor. We're using PrimeNG 17.18.12 with quill 2.0.3. We reverted to quill 2.0.2 because of this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue where all whitespaces (not only consecutive ones) are after updating.
I'm using it in laravel and then line brakes are an issue on the page and when sent to pdf.
edit: even when writing text directly and not copy pasting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue in our project - we got this package as ^2.0.0
and it got this BRAKING CHANGE update 😢. Many records in DB with [NBSP]
flood... 😞 . Reverted to 2.0.2
without ^
ever since.
Also using: editor.getSemanticHTML()
No description provided.