codeapprove / feedback

Feedback for CodeApprove
0 stars 0 forks source link

Pasting on top of existing text pastes with formatting #55

Closed mtlynch closed 2 years ago

mtlynch commented 2 years ago

If I copy some text from a code review and paste it into my comment, CodeApprove pastes it as plaintext, as expected.

If I paste the text on top of existing text in the comment, CodeApprove pastes the text with a huge amount of HTML formatting, which is unexpected.

https://user-images.githubusercontent.com/7783288/188738923-4f4e84fe-823b-45c5-bab8-2c2371edab39.mp4

Observed on Firefox 104 on Win10.

samatcodeapprove commented 2 years ago

Wow that is really really strange! Thanks for reporting, I’ll dig into it.

samatcodeapprove commented 2 years ago

TIL something new about the clipboard API. Deployed a new build which fixes this.

mtlynch commented 2 years ago

Thanks!

TIL something new about the clipboard API.

Yeah, I delved into it a few months ago and it has some fun surprises.

Deployed a new build which fixes this.

I'm still seeing unexpected behavior on this. If I type "test" in the comment field, highlight it, and then paste https://google.com/ it pastes the text:

https://google.com/[](https://google.com/)

I would expect it to do one of the following instead:

CodeApprove assumes I want to make the text a link

[test](https://google.com/)

CodeApprove assumes I want to replace the text with a link

<https://google.com>
samatcodeapprove commented 2 years ago

D'oh sorry about that. Pushing a re-fix now.

mtlynch commented 2 years ago

Verified, thanks!