Add paste event handler to allow pasting markdown
Fixes https://github.com/nextcloud/text/issues/16
Marking as draft as this still needs a bit of testing if this is feasible for common use cases of pasting random text
While I have the use case very often, I'd still be curious if anyone could think of scenarios where just always parsing pasted text as markdown could be unexpected to users. Any objections @nextcloud/office ?
Nice, I would love to be able to paste markdown and get it formatted direclty!
This should also fix #55.
This should also fix #55.
No that one is about typing not pasting, but this would fix #938
I'd still be curious if anyone could think of scenarios where just always parsing pasted text as markdown could be unexpected to users.
When pasting markdown into a codeblock i would expect it to show up as source code not interpreted as markup.
Maybe this would be better as a context menu option similar to how Word processors have different options on how to paste
Or to follow common practice:
Use this for all normal paste and add a handler for ctrl + shift + v to paste without formatting.
Changed the approach a bit by using clipboardTextParser and skipping the markdown parsing when Ctrl+Shift+V is used.
🏓 For review ;)
Test summary
Run details
| Project | Text |
| Status | Passed |
| Commit | 1d35c76ee5 ℹ️ |
| Started | Nov 9, 2022 3:34 PM |
| Ended | Nov 9, 2022 3:41 PM |
| Duration | 07:11 💡 |
| OS | Linux Ubuntu - |
| Browser | Electron 106 |
View run in Cypress Dashboard ➡️
Flakiness
|
|
cypress/e2e/sections.spec.js |
1 |
|
|---|---|---|---|
| 1 | Content Sections > Heading anchors > Anchor scrolls into view |
|
|
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
/compile