You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Tracking Issue] Implement HTML -> Markdown conversions in Expensimark #3047
Expensify.cash uses the Expensimark library in the expensify-common repo to convert markdown to HTML. That way, a user can compose a message using markdown, and it can be displayed + stored using HTML. However, when a user later goes to edit the message, we currently have no way to take the HTML and display it to them as markdown. We also don't want to store the original markdown in our database.
Why this is important
Editing comments is an important usability feature in Expensify.cash. However, we need to make sure that the edit-comment experience is as similar as possible to the original message composition experience.
Solution
Implement bi-directional HTML <---> Markdown conversion in Expensimark for all of the elements we currently support for Markdown ---> HTML conversion:
changed the title [-][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/-][+][HOLD][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/+]on May 21, 2021
HOLDing this on a POC PR over here. We might need to do an internal PR to update our other repos that also use Expensimark, depending on how we change the Expensimark interface.
@roryabraham I was just thinking about this–and sorry if this has already been considered–but why don't we just store both the HTML and markdown versions of the report comment, and switch between the two for editing/copying report comments?
To minimize space, we can only store the HTML if the markdown and the HTML are identical (and default to it if the markdown version doesn't exist).
Feel like this would be a whole lot simpler than doing a bunch of string manipulation on HTML to make it look like markdown–we'd probably also avoid a bunch of bugs this way.
@jasperhuangg has raised a very good point. But I think it in another way. I would say that we should save the MD as I believe converting HTML to markdown will loose original MD markup which user entered.
And we can always convert the MD to HTML uniformly.
I don't necessarily disagree @jasperhuangg, but this was discussed in slack here. If you'd like to reopen the discussion, I think Slack would be the best place for that so it gets better visibility. The reason we didn't go with that solution is that it will nearly double the amount of data we need to store in our largest table.
But @parasharrajat has introduced an interesting solution I don't believe was discussed before – only store the plain-text (markdown) version of a comment, then convert it to HTML only when needed.
changed the title [-][HOLD][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/-][+][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/+]on Jun 21, 2021
When I edit a chat that has a link to it already, the link turns into plain text and removes the hyper link, and I can’t edit it again to make it a link
Looks like all the issues on our checklist are done here. I think I am going to ask Applause to do some extra QA here before we close this out and call it done.
Activity
[-][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/-][+][HOLD][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/+]roryabraham commentedon May 21, 2021
HOLDing this on a POC PR over here. We might need to do an internal PR to update our other repos that also use Expensimark, depending on how we change the Expensimark interface.
jasperhuangg commentedon Jun 7, 2021
@roryabraham I was just thinking about this–and sorry if this has already been considered–but why don't we just store both the HTML and markdown versions of the report comment, and switch between the two for editing/copying report comments?
To minimize space, we can only store the HTML if the markdown and the HTML are identical (and default to it if the markdown version doesn't exist).
Feel like this would be a whole lot simpler than doing a bunch of string manipulation on HTML to make it look like markdown–we'd probably also avoid a bunch of bugs this way.
parasharrajat commentedon Jun 7, 2021
@jasperhuangg has raised a very good point. But I think it in another way. I would say that we should save the MD as I believe converting HTML to markdown will loose original MD markup which user entered.
And we can always convert the MD to HTML uniformly.
roryabraham commentedon Jun 7, 2021
I don't necessarily disagree @jasperhuangg, but this was discussed in slack here. If you'd like to reopen the discussion, I think Slack would be the best place for that so it gets better visibility. The reason we didn't go with that solution is that it will nearly double the amount of data we need to store in our largest table.
But @parasharrajat has introduced an interesting solution I don't believe was discussed before – only store the plain-text (markdown) version of a comment, then convert it to HTML only when needed.
roryabraham commentedon Jun 18, 2021
Raised the proposal to store only markdown in this slack thread.
roryabraham commentedon Jun 21, 2021
Moving forward with the original plan, I'm taking this off hold.
[-][HOLD][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/-][+][Tracking Issue] Implement HTML -> Markdown conversions in Expensimark[/+]roryabraham commentedon Jun 21, 2021
For reference, this PR was merged as a POC, and it's being integrated into E.cash here.
parasharrajat commentedon Jul 14, 2021
@Jag96 We can mark finished tags on the list.
Jag96 commentedon Jul 14, 2021
Marked off the finished tags, left
<br>unchecked and linked the bug we foundparasharrajat commentedon Jul 20, 2021
@Jag96 Let's open another issue for other tags. I see many complaints about it.
isagoico commentedon Jul 20, 2021
Make hyperlinks editable in chat comments
Action Performed
Expected result
Hyperlink markdown should be visible when editing the comment
Actual result
Hyperlink markdown is removed when editing the comment and then it's saved as plain text.
Notes/images/Video
Recording.198.mp4
From @joaniew https://expensify.slack.com/archives/C01GTK53T8Q/p1626810543044700
6 remaining items
roryabraham commentedon Aug 11, 2021
Looks to me like everything except #4188 is done or almost done
parasharrajat commentedon Aug 11, 2021
That is also done.
roryabraham commentedon Aug 24, 2021
Looks like all the issues on our checklist are done here. I think I am going to ask Applause to do some extra QA here before we close this out and call it done.
roryabraham commentedon Aug 24, 2021
Additional QA steps I would like to have done:
roryabraham commentedon Aug 24, 2021
QA requested in Slack
roryabraham commentedon Sep 1, 2021
Bumped Applause in slack here
roryabraham commentedon Sep 1, 2021
Cool, actually Applause completed the exploratory testing we requested and exported these follow-up issues:
Since those are all being processed by our engineering pipeline independently, I think we can close this out.