-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
The "Blank space" before and after a string is ignored when pasting #1752
Comments
I tried this solution:
it seems fixed this problem, coz this style rule will turn every <p> fdfsdfdsf</p> but, when you put content that contains <p> fdfsdfdsf</p> Is there any solution for this, can I turn this |
i already tried white-space:normal , but its not working |
are there any updates? |
For those who is still suffering from this nasty issue in 2021 O_o: // this module is to workaround a nasty issue with preserving white spaces (they got stripped out):
// https://github.com/quilljs/quill/issues/1752
// https://github.com/quilljs/quill/issues/2459
// https://github.com/quilljs/quill/issues/1751
class PreserveWhiteSpace {
constructor(private quill: any, private options: {}) {
quill.container.style.whiteSpace = "pre-line";
}
}
Quill.register('modules/preserveWhiteSpace', PreserveWhiteSpace); Do not forget to add export const quillModulesBasic: Quill.StringMap = {
imageResize: {
modules: [ 'Resize', 'DisplaySize' ]
},
clickableLink: true,
preserveWhiteSpace: true,
toolbar: [
['bold', 'italic', 'underline', 'strike', 'blockquote'],
... The root cause is in the |
@vkolotov it saved my day, thank you! Anyway, my case about the wrong caret position after restore the last selection and it works perfectly though. |
@vkolotov That is TypeScript, correct? That isn't working for me when attempting this same solution in vanilla JS
|
Just add style to .ql-clipboard {
left: -100000px;
height: 1px;
overflow-y: hidden;
position: absolute;
top: 50%;
// ensure quill clipboard preserve whitespaces
white-space: pre-wrap;
word-wrap: break-word;
} Try it here |
I'm using react-quill and this seemed to work for me. |
I am using Angular and this worked for me! Thank you so much :D. |
From: mozilla/notes#262
[Affected versions]:
[Affected Platforms]:
[Prerequisites]:
[Steps to reproduce]:
[Expected result]:
[Actual result]:
[Notes]:
The text was updated successfully, but these errors were encountered: