App: [HOLD for payment 2022-12-08] [$1000] Incorrect pasted text on copied HTML snippet reported by @kerupuksambel
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Open staging.new.expensify.com
- Send this HTML snippet to someone :
<a href="takia.html">asd</a>
- Right click on the message and select the option “Copy to clip board” and paste it to either an external text editor or Expensify textbox
Expected Result:
The pasted text is the same as the copied text
Actual Result:
The pasted text on the external text editor is only asd while the pasted text on the Expensify textbox is [asd](https://staging.new.expensify.com/r/takia.html)
Workaround:
unknown
Platform:
Where is this issue occurring?
- Web
Version Number: 1.2.21-4
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Expensify/Expensify Issue URL:
Issue reported by: @kerupuksambel
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1666969406840619
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~015b92dc642f298147
- Upwork Job ID: 1595305377206034432
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 43 (27 by maintainers)
So sorry for the payment delay, I wasn’t sure if there was a regression and I was ooo for a bit. Paid and closed the job.
@b1tjoy $1000 for the fix & $500 bonus (PR in 3 days) @thesahindia $1000 as C+ & $500 bonus (PR in 3 days) @kerupuksambel $250 for reporting
@thesahindia let’s move forward with @b1tjoy’s proposal.
https://github.com/Expensify/App/pull/11905
https://github.com/Expensify/App/pull/11905#issuecomment-1358063814
https://expensify.slack.com/archives/C049HHMV9SM/p1671474832197629
Need help with this one @danieldoglas
Oh whoops, I’m flying through too many issues. Thanks!
@Christinadobrzyn, please hire @b1tjoy.
@Christinadobrzyn I agree, this can definitely be external.
This one is a regression of PR https://github.com/Expensify/App/pull/11905,
ExpensiMark
definitely expects encoded html string as parameter.https://github.com/Expensify/expensify-common/blob/490d695c8ceb54bcff736785b54f06057c32fc9b/lib/ExpensiMark.js#L479
Solution fix both current issue and https://github.com/Expensify/App/issues/11693
Remove the code which encode the selection html.
https://github.com/Expensify/App/blob/0d653cad15c32150c302ac12dc0acdbca1ece18b/src/libs/SelectionScraper/index.js#L136
Set decoded html to clipboard as
text/plain
type.https://github.com/Expensify/App/blob/0d653cad15c32150c302ac12dc0acdbca1ece18b/src/components/CopySelectionHelper.js#L38
https://github.com/Expensify/App/blob/0d653cad15c32150c302ac12dc0acdbca1ece18b/src/pages/home/report/ContextMenu/ContextMenuActions.js#L112
You may noticed that we found incorrect use of
htmlToText()
in https://github.com/Expensify/App/issues/10262#issuecomment-1310494115, I suggest we fix both https://github.com/Expensify/App/issues/11693 and https://github.com/Expensify/App/issues/12271 in solution of https://github.com/Expensify/App/issues/10262.Screenshot
https://user-images.githubusercontent.com/103875612/201457073-2779492c-7be0-4e5b-8478-ff4df3cb0ac5.mp4
Hi @kerupuksambel! Thank you so much for the insight - testing this:
Using Copy to Clipboard
<a href="takia.html">asd</a>
in a chat in staging<a href="takia.html">asd</a>
in text editorUsing Ctrl+C / Cmd+C
<a href="takia.html">asd</a>
in a chat in stagingasd
in text editorSo the Copy to Clipboard is pasting the
<a href="takia.html">asd</a>
code into text edit whereas the Ctrl+C / Cmd+C & Ctrl+V / Cmd + V is pasting the result of the codeasd
. Interesting!I think this might be similar to this issue https://github.com/Expensify/App/issues/10262 - @parasharrajat would you be able to take a peek at this and see if you think it will be fixed with the changes you’re working on in https://github.com/Expensify/App/issues/10262