-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tracking Issue] Implement HTML -> Markdown conversions in Expensimark #3047
Comments
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. |
Raised the proposal to store only markdown in this slack thread. |
Moving forward with the original plan, I'm taking this off hold. |
@Jag96 We can mark finished tags on the list. |
Marked off the finished tags, left |
@Jag96 Let's open another issue for other tags. I see many complaints about it. |
Make hyperlinks editable in chat commentsAction Performed
Expected resultHyperlink markdown should be visible when editing the comment Actual resultHyperlink markdown is removed when editing the comment and then it's saved as plain text. Notes/images/Video Recording.198.mp4From @joaniew https://expensify.slack.com/archives/C01GTK53T8Q/p1626810543044700
|
@parasharrajat it sounds like your proposal for #4169 will solve |
@Jag96 No. That proposal fixes the content pasting by excluding not-needed tags. We are still lacking Link parsing. Until we have HTML to MD parser for links, |
Ok sounds good, I'll make new issues then for each of the items in the checklist |
@Jag96 Links and emails links can go into one. There will be one regex for both. |
|
Looks to me like everything except #4188 is done or almost done |
That is also done. |
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. |
Additional QA steps I would like to have done:
|
QA requested in Slack |
Bumped Applause in slack here |
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. |
Problem
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:
<br />
- [HOLD for payment July 22] Update line break regex for HTML->Markdown to support break tags with styles #4052&
currently looks like&
when you go to edit a previously sent message with&
in it) - [HOLD for payment August 4) Fix message Editing and pasting issues. #4169The text was updated successfully, but these errors were encountered: