App icon indicating copy to clipboard operation
App copied to clipboard

[Hold for payment 2021-09-07] Copy and pasting text into a chat gives you html decoded strings

Open parasharrajat opened this issue 5 years ago β€’ 17 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. open newDot on the web.
  2. Copy some text that contains whitespaces from the Mac's Note.app or any other application.
  3. Paste that into the composer.

Expected Result:

Special Html entities should be shown correctly.

Actual Result:

You can see a lot of them in HTML form. e.g. service.  ,   We’ve, haven’t .

Workaround:

None.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: latest

Notes/Photos/Videos: https://expensify.slack.com/archives/C01GTK53T8Q/p1629395261042000?thread_ts=1627358860.323100&cid=C01GTK53T8Q

View all open jobs on GitHub

parasharrajat avatar Aug 19 '21 18:08 parasharrajat

Triggered auto assignment to @laurenreidexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Aug 19 '21 18:08 MelvinBot

Explanation.

  • A lot of apps use HTML entities instead of ASCII characters which when pasted to composer are not decoded.

Proposal

  1. There is a good library that does this for us https://www.npmjs.com/package/html-entities.
  2. But this contains a lot of code which we don't really need.
  3. So my idea is to extract the List of chars from https://github.com/mdevils/html-entities/blob/master/src/named-references.ts.
  4. Then using the regexp match we can convert them easily without using the library.
  5. This function will be an extended version of underscore the _.unscape https://github.com/jashkenas/underscore/blob/master/modules/_createEscaper.js

parasharrajat avatar Aug 19 '21 18:08 parasharrajat

@parasharrajat already fixed some examples in this GH https://github.com/Expensify/App/issues/4169 Let's make sure we address any/all relevant ones so we don't end up with a ton of small issues/fixes (which eat away at valuable resources)

mallenexpensify avatar Aug 19 '21 18:08 mallenexpensify

Triggered auto assignment to @kadiealexander (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Aug 20 '21 09:08 MelvinBot

I'm OOO next week so reassigning this - looks like @mallenexpensify might have a steer on whether we need to move this one to engineering

laurenreidexpensify avatar Aug 20 '21 09:08 laurenreidexpensify

Seems like a reasonable formatting change! Sending to eng for another set of eyes.

kadiealexander avatar Aug 22 '21 22:08 kadiealexander

Triggered auto assignment to @Julesssss (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Aug 22 '21 22:08 MelvinBot

Hi @parasharrajat. Love the proposal as it removes the library dependency. Please make a start when you're ready.

Julesssss avatar Aug 23 '21 09:08 Julesssss

Triggered auto assignment to @arielgreen (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Aug 23 '21 09:08 MelvinBot

Whoops, I assumed I was assigned via the Exported label. Please hold until we reach that step πŸ˜„

Julesssss avatar Aug 23 '21 09:08 Julesssss

Posted job and invited @parasharrajat.

arielgreen avatar Aug 23 '21 21:08 arielgreen

Whoops! Forgot to finalize the hire in Upwork before, sorry about that. @parasharrajat! Just hired you there as well.

arielgreen avatar Aug 26 '21 21:08 arielgreen

πŸš€ Deployed to staging by @Beamanator in version: 1.0.88-3 πŸš€

platform result
πŸ€– android πŸ€– cancelled πŸ”ͺ
πŸ–₯ desktop πŸ–₯ cancelled πŸ”ͺ
🍎 iOS 🍎 cancelled πŸ”ͺ
πŸ•Έ web πŸ•Έ success βœ…

botify avatar Aug 30 '21 17:08 botify

πŸš€ Deployed to production by @roryabraham in version: 1.0.90-2 πŸš€

platform result
πŸ€– android πŸ€– success βœ…
πŸ–₯ desktop πŸ–₯ success βœ…
🍎 iOS 🍎 failure ❌
πŸ•Έ web πŸ•Έ success βœ…

botify avatar Sep 01 '21 01:09 botify

Sorry, we missed the payment notification somehow, my fault.

Julesssss avatar Sep 02 '21 09:09 Julesssss

@arielgreen this can be paid today πŸŽ‰

Julesssss avatar Sep 07 '21 10:09 Julesssss

Paid + bonus for reporting, thanks for your work here @parasharrajat!

arielgreen avatar Sep 07 '21 17:09 arielgreen