-
Notifications
You must be signed in to change notification settings - Fork 108
Treat newlines as linebreaks when pasting as plaintext #3623
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
Conversation
Until now, every newline was transformed into a paragraph break when pasting plaintext. Instead, newlines will be treated as linebreaks. Two newlines in a row will be treated as paragraph break. Fixes: #3598 Signed-off-by: Jonas <jonas@freesources.org>
We distinguish between <Ctrl>-<V> and <Ctrl>-<Shift>-<V> when pasting text to decide whether the input should be treated as markdown or plaintext. On Linux systems, it's also possible to paste text with a middle mouse click. Let's consider there as well whether the <Shift> key is down. Sidenote: with shift key down, the handleClick and handleClickOn events are not called, so we have to go through the DOM events directly. Signed-off-by: Jonas <jonas@freesources.org>
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
||||||||||||||||||||||||||
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.
Approach looks good. Please check my comment and play with that a bit. I don't know of the top of my head how the code will behave. Feel free to merge as is if the behavior makes sense.
update: I did so myself.
📝 Summary
Until now, every newline was transformed into a paragraph break when pasting plaintext.
Instead, newlines will be treated as linebreaks. Two newlines in a row will be treated as paragraph break.
Fixes: #3598
The second commit in this PR adds a change to catch shiftKey when pasting with middle click.
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)