App: Edit comment - Spaces are not displayed in edit box

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Expected Result:

Spaces should be visible in edit comment box

Actual Result:

Spaces are not visible in edit comment box.

Action Performed:

  1. Navigate to a conversation
  2. Send a message with the following text
Hello 
Space
Test
  1. Right click on the message and click edit comment.

Workaround:

N/a

Platform:

Where is this issue occurring?

Web ✔️ iOS Android Desktop App Mobile Web

Version Number: 1.0.43-0

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:

image

Expensify/Expensify Issue URL: https://www.upwork.com/jobs/~01aab2d470107fe14c

View all open jobs on Upwork


From @roryabraham https://expensify.slack.com/archives/C01GTK53T8Q/p1620849222131700

When editing a comment, newlines do not appear in the text box.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 38 (33 by maintainers)

Most upvoted comments

@pranshuchittora That looks correct to me! Generally speaking, we try to match GitHub-flavored markdown.

To summarise

  1. Successfully merge the PR in expensify-common.
  2. Change the version of expensify-common to the merge commit hash in E.cash repo (this repo).

Is this correct?

cc @jasperhuangg @marcaaron

Created a tracking issue for other HTML —> MD conversions here

@pranshuchittora just sent you the contract in Upwork, thanks!

Also, it might be fine for this work to be split up into several issues - but we can start by handling the line breaks at least?

Ok based on the conversations in Slack I think that how we should handle this is:

  1. Stop referencing the text field altogether as we are discussing deprecating it and removing it
  2. Implement a reverse parser in ExpensiMark that will convert HTML back into our own custom flavor of markdown. Something like:
const parser = new ExpensiMark();
const markdownTextForEditor = parser.HTMLtoMarkdown(/* html string */)
  1. Include automated tests for ExpensiMark()
  2. Finally, update this code so that we are converting the html to markdown before setting the draft message for edit instead of grabbing the text value

https://github.com/Expensify/Expensify.cash/blob/087205d81ed0bf3b072d85e09c20bf2af1c91262/src/pages/home/report/ReportActionContextMenu.js#L141-L149